emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110570: Fix warnings when compiling


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110570: Fix warnings when compiling on MS-Windows with -std=gnu99.
Date: Wed, 17 Oct 2012 21:02:44 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110570
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2012-10-17 21:02:44 +0200
message:
  Fix warnings when compiling on MS-Windows with -std=gnu99.
  
   src/makefile.w32-in ($(BLD)/w32.$(O)): 
   ($(BLD)/vm-limit.$(O)): 
   ($(BLD)/term.$(O)): 
   ($(BLD)/unexw32.$(O)): 
   ($(BLD)/fileio.$(O)): 
   ($(BLD)/dispnew.$(O)): Update dependencies.
   src/w32term.h (w32_initialize_display_info, initialize_w32_display):
   Add prototypes.
   src/w32proc.c: Include ctype.h.
   src/w32.h (init_environment, check_windows_init_file)
   (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
   (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
   (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
   (sys_link): Add prototypes.
   src/w32.c: Include w32select.h.
   (sys_access, e_malloc, sys_select): Add prototypes.
   (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
   src/vm-limit.c [WINDOWSNT]: Include w32heap.h.
   src/unexw32.c: Include lisp.h and w32.h.
   src/term.c [WINDOWSNT]: Include w32term.h.
   src/process.c [WINDOWSNT]: Add prototype of sys_select.
   src/fileio.c [WINDOWSNT]: Include w32.h.
   src/dispnew.c [WINDOWSNT]: Include w32.h.
  
   nt/inc/pwd.h (getuid, geteuid): Add prototypes.
   nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
   (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
   (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
   (sys_kill, getpagesize): Add prototypes for emulated functions.
   nt/inc/grp.h (getgid, getegid): Add prototypes.
   nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
   nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when
   compiling with -std=gnu99.
   nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
   could be used via --cflags switch to configure.bat.
modified:
  nt/ChangeLog
  nt/config.nt
  nt/configure.bat
  nt/gmake.defs
  nt/inc/grp.h
  nt/inc/ms-w32.h
  nt/inc/pwd.h
  src/ChangeLog
  src/dispnew.c
  src/fileio.c
  src/makefile.w32-in
  src/process.c
  src/term.c
  src/unexw32.c
  src/vm-limit.c
  src/w32.c
  src/w32.h
  src/w32proc.c
  src/w32term.h
=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2012-10-17 11:24:34 +0000
+++ b/nt/ChangeLog      2012-10-17 19:02:44 +0000
@@ -1,3 +1,22 @@
+2012-10-17  Eli Zaretskii  <address@hidden>
+
+       * inc/pwd.h (getuid, geteuid): Add prototypes.
+
+       * inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
+       (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
+       (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
+       (sys_kill, getpagesize): Add prototypes for emulated functions.
+
+       * inc/grp.h (getgid, getegid): Add prototypes.
+
+       * gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
+
+       * configure.bat (chkapiN): Avoid compiler warning in junk.c when
+       compiling with -std=gnu99.
+
+       * config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
+       could be used via --cflags switch to configure.bat.
+
 2012-10-08  Juanma Barranquero  <address@hidden>
 
        * config.nt: Sync with autogen/config.in.

=== modified file 'nt/config.nt'
--- a/nt/config.nt      2012-10-08 14:14:22 +0000
+++ b/nt/config.nt      2012-10-17 19:02:44 +0000
@@ -76,7 +76,7 @@
 #undef CANNOT_DUMP
 
 /* Define this to enable compile time checks for the Lisp_Object data type. */
-#undef CHECK_LISP_OBJECT_TYPE
+/* #undef CHECK_LISP_OBJECT_TYPE */
 
 /* Define if you want lock files to be written, so that Emacs can tell
    instantly when you try to modify a file that someone else has modified in

=== modified file 'nt/configure.bat'
--- a/nt/configure.bat  2012-09-18 10:49:33 +0000
+++ b/nt/configure.bat  2012-10-17 19:02:44 +0000
@@ -429,7 +429,7 @@
 echo Checking whether Windows API headers are too old...
 echo #include "windows.h" >junk.c
 echo #include "usp10.h" >>junk.c
-echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c
+echo void test(PIMAGE_NT_HEADERS pHeader) >>junk.c
 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
 if (%nocygwin%) == (Y) goto chkapi1
 set cf=%usercflags%

=== modified file 'nt/gmake.defs'
--- a/nt/gmake.defs     2012-09-30 21:36:42 +0000
+++ b/nt/gmake.defs     2012-10-17 19:02:44 +0000
@@ -211,7 +211,7 @@
 OBJ2_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2))
 
 ifdef NOOPT
-DEBUG_CFLAGS   = -DEMACSDEBUG -fno-crossjumping
+DEBUG_CFLAGS   = -DEMACSDEBUG -fno-crossjumping -std=gnu99
 else
 DEBUG_CFLAGS   =
 endif

=== modified file 'nt/inc/grp.h'
--- a/nt/inc/grp.h      2012-01-19 07:21:25 +0000
+++ b/nt/inc/grp.h      2012-10-17 19:02:44 +0000
@@ -28,7 +28,10 @@
   gid_t gr_gid;                /* group numerical ID */
 };
 
-struct group *getgrgid(gid_t);
+extern unsigned getgid (void);
+extern unsigned getegid (void);
+
+extern struct group *getgrgid(gid_t);
 
 #endif /* _GRP_H */
 

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2012-09-30 21:36:42 +0000
+++ b/nt/inc/ms-w32.h   2012-10-17 19:02:44 +0000
@@ -120,21 +120,6 @@
 #endif
 #include <sys/types.h>
 
-#ifdef _MSC_VER
-typedef int sigset_t;
-typedef int ssize_t;
-#endif
-
-struct sigaction {
-  int sa_flags;
-  void (_CALLBACK_ *sa_handler)(int);
-  sigset_t sa_mask;
-};
-#define SA_RESTART      0
-#define SIG_BLOCK       1
-#define SIG_SETMASK     2
-#define SIG_UNBLOCK     3
-
 #ifndef MAXPATHLEN
 #define MAXPATHLEN      _MAX_PATH
 #endif
@@ -207,6 +192,8 @@
 /* Internal signals.  */
 #define emacs_raise(sig) emacs_abort()
 
+extern int sys_wait (int *);
+
 /* termcap.c calls that are emulated.  */
 #define tputs   sys_tputs
 #define tgetstr sys_tgetstr
@@ -251,6 +238,9 @@
 #define stricmp   _stricmp
 #define tzset     _tzset
 
+/* We cannot include system header process.h, since there's src/process.h.  */
+int _getpid (void);
+
 /* Include time.h before redirecting tzname, since MSVC's time.h
    defines _tzname to call a function, but also declares tzname a
    2-element array.  Having the redirection before including the
@@ -272,6 +262,10 @@
   long int     tv_nsec;        /* nanoseconds */
 };
 
+/* Required for functions in lib/time_r.c, since we don't use lib/time.h.  */
+extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
+extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
+
 /* This is hacky, but is necessary to avoid warnings about macro
    redefinitions using the SDK compilers.  */
 #ifndef __STDC__
@@ -300,6 +294,37 @@
 #define NSIG 23
 #endif
 
+#ifdef _MSC_VER
+typedef int sigset_t;
+typedef int ssize_t;
+#endif
+
+typedef void (_CALLBACK_ *signal_handler) (int);
+extern signal_handler sys_signal (int, signal_handler);
+
+struct sigaction {
+  int sa_flags;
+  void (_CALLBACK_ *sa_handler)(int);
+  sigset_t sa_mask;
+};
+#define SA_RESTART      0
+#define SIG_BLOCK       1
+#define SIG_SETMASK     2
+#define SIG_UNBLOCK     3
+
+extern int sigemptyset (sigset_t *);
+extern int sigaddset (sigset_t *, int);
+extern int sigfillset (sigset_t *);
+extern int sigprocmask (int, const sigset_t *, sigset_t *);
+extern int pthread_sigmask (int, const sigset_t *, sigset_t *);
+extern int sigismember (const sigset_t *, int);
+extern int setpgrp (int, int);
+extern int sigaction (int, const struct sigaction *, struct sigaction *);
+extern int alarm (int);
+
+extern int sys_kill (int, int);
+
+
 /* For integration with MSDOS support.  */
 #define getdisk()               (_getdrive () - 1)
 #ifdef emacs
@@ -357,6 +382,7 @@
 #endif
 
 extern int getloadavg (double *, int);
+extern int getpagesize (void);
 
 #if defined (__MINGW32__)
 

=== modified file 'nt/inc/pwd.h'
--- a/nt/inc/pwd.h      2011-01-15 23:16:57 +0000
+++ b/nt/inc/pwd.h      2012-10-17 19:02:44 +0000
@@ -18,8 +18,11 @@
 typedef unsigned uid_t;
 typedef uid_t gid_t;
 
-struct passwd * getpwnam (char *);
-struct passwd * getpwuid (unsigned);
+extern unsigned getuid (void);
+extern unsigned geteuid (void);
+
+extern struct passwd * getpwnam (char *);
+extern struct passwd * getpwuid (unsigned);
 
 
 #endif /* _PWD_H_ */

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-17 15:37:55 +0000
+++ b/src/ChangeLog     2012-10-17 19:02:44 +0000
@@ -1,5 +1,39 @@
 2012-10-17  Eli Zaretskii  <address@hidden>
 
+       * makefile.w32-in ($(BLD)/w32.$(O)): 
+       ($(BLD)/vm-limit.$(O)): 
+       ($(BLD)/term.$(O)): 
+       ($(BLD)/unexw32.$(O)): 
+       ($(BLD)/fileio.$(O)): 
+       ($(BLD)/dispnew.$(O)): Update dependencies.
+
+       * w32term.h (w32_initialize_display_info, initialize_w32_display):
+       Add prototypes.
+
+       * w32proc.c: Include ctype.h.
+
+       * w32.h (init_environment, check_windows_init_file)
+       (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
+       (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
+       (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
+       (sys_link): Add prototypes.
+
+       * w32.c: Include w32select.h.
+       (sys_access, e_malloc, sys_select): Add prototypes.
+       (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
+
+       * vm-limit.c [WINDOWSNT]: Include w32heap.h.
+
+       * unexw32.c: Include lisp.h and w32.h.
+
+       * term.c [WINDOWSNT]: Include w32term.h.
+
+       * process.c [WINDOWSNT]: Add prototype of sys_select.
+
+       * fileio.c [WINDOWSNT]: Include w32.h.
+
+       * dispnew.c [WINDOWSNT]: Include w32.h.
+
        * cygw32.c (Fcygwin_convert_path_to_windows)
        (Fcygwin_convert_path_from_windows): Use EQ to compare 2
        Lisp_Object values.  (Bug#12661)

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2012-10-10 20:09:47 +0000
+++ b/src/dispnew.c     2012-10-17 19:02:44 +0000
@@ -60,6 +60,10 @@
 #if defined (HAVE_TERM_H) && defined (GNU_LINUX)
 #include <term.h>              /* for tgetent */
 #endif
+
+#ifdef WINDOWSNT
+#include "w32.h"
+#endif
 
 /* Structure to pass dimensions around.  Used for character bounding
    boxes, glyph matrix dimensions and alike.  */

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-10-13 08:55:26 +0000
+++ b/src/fileio.c      2012-10-17 19:02:44 +0000
@@ -53,6 +53,7 @@
 #include <windows.h>
 #include <fcntl.h>
 #include <sys/file.h>
+#include "w32.h"
 #endif /* not WINDOWSNT */
 
 #ifdef MSDOS

=== modified file 'src/makefile.w32-in'
--- a/src/makefile.w32-in       2012-10-12 16:32:40 +0000
+++ b/src/makefile.w32-in       2012-10-17 19:02:44 +0000
@@ -735,6 +735,7 @@
        $(SRC)/disptab.h \
        $(SRC)/indent.h \
        $(SRC)/termchar.h \
+       $(SRC)/w32.h \
        $(NT_INC)/unistd.h \
        $(BUFFER_H) \
        $(CHARACTER_H) \
@@ -832,6 +833,7 @@
        $(SRC)/fileio.c \
        $(SRC)/blockinput.h \
        $(SRC)/commands.h \
+       $(SRC)/w32.h \
        $(NT_INC)/pwd.h \
        $(NT_INC)/sys/file.h \
        $(NT_INC)/sys/stat.h \
@@ -1173,6 +1175,7 @@
        $(SRC)/w32.h \
        $(SRC)/w32common.h \
        $(SRC)/w32heap.h \
+       $(SRC)/w32select.h \
        $(NT_INC)/pwd.h \
        $(NT_INC)/sys/file.h \
        $(NT_INC)/sys/time.h \
@@ -1428,6 +1431,7 @@
        $(SYSSIGNAL_H) \
        $(SYSTTY_H) \
        $(TERMHOOKS_H) \
+       $(W32TERM_H) \
        $(WINDOW_H)
 
 $(BLD)/terminal.$(O) : \
@@ -1468,13 +1472,16 @@
 $(BLD)/unexw32.$(O) : \
        $(SRC)/unexw32.c \
        $(SRC)/unexec.h \
+       $(SRC)/w32.h \
        $(SRC)/w32common.h \
        $(SRC)/w32heap.h \
+       $(LISP_H) \
        $(CONFIG_H)
 
 $(BLD)/vm-limit.$(O) : \
        $(SRC)/vm-limit.c \
        $(SRC)/mem-limits.h \
+       $(SRC)/w32heap.h \
        $(NT_INC)/unistd.h \
        $(CONFIG_H) \
        $(LISP_H)

=== modified file 'src/process.c'
--- a/src/process.c     2012-10-13 00:52:01 +0000
+++ b/src/process.c     2012-10-17 19:02:44 +0000
@@ -125,6 +125,11 @@
 #include "xgselect.h"
 #endif
 
+#ifdef WINDOWSNT
+extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
+                      EMACS_TIME *, void *);
+#endif
+
 #ifndef WNOHANG
 # undef waitpid
 # define waitpid(pid, status, options) wait (status)

=== modified file 'src/term.c'
--- a/src/term.c        2012-10-10 15:10:57 +0000
+++ b/src/term.c        2012-10-17 19:02:44 +0000
@@ -66,6 +66,7 @@
 /* The name of the default console device.  */
 #ifdef WINDOWSNT
 #define DEV_TTY  "CONOUT$"
+#include "w32term.h"
 #else
 #define DEV_TTY  "/dev/tty"
 #endif

=== modified file 'src/unexw32.c'
--- a/src/unexw32.c     2012-10-08 12:53:18 +0000
+++ b/src/unexw32.c     2012-10-17 19:02:44 +0000
@@ -22,7 +22,9 @@
 
 #include <config.h>
 #include "unexec.h"
+#include "lisp.h"
 #include "w32common.h"
+#include "w32.h"
 
 #include <stdio.h>
 #include <fcntl.h>

=== modified file 'src/vm-limit.c'
--- a/src/vm-limit.c    2012-09-30 21:36:42 +0000
+++ b/src/vm-limit.c    2012-10-17 19:02:44 +0000
@@ -85,6 +85,8 @@
 #else /* not USG */
 #ifdef WINDOWSNT
 
+#include "w32heap.h"
+
 static void
 get_lim_data (void)
 {

=== modified file 'src/w32.c'
--- a/src/w32.c 2012-10-12 15:30:06 +0000
+++ b/src/w32.c 2012-10-17 19:02:44 +0000
@@ -175,6 +175,7 @@
 #include "ndir.h"
 #include "w32common.h"
 #include "w32heap.h"
+#include "w32select.h"
 #include "systime.h"
 #include "dispextern.h"                /* for xstrcasecmp */
 #include "coding.h"            /* for Vlocale_coding_system */
@@ -198,6 +199,12 @@
 static int restore_privilege (TOKEN_PRIVILEGES *);
 static BOOL WINAPI revert_to_self (void);
 
+extern int sys_access (const char *, int);
+extern void *e_malloc (size_t);
+extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
+                      EMACS_TIME *, void *);
+
+
 
 /* Initialization states.
 
@@ -6961,7 +6968,7 @@
 {
   int n, sc, err;
   SELECT_TYPE fdset;
-  struct timeval timeout;
+  EMACS_TIME timeout;
   struct Lisp_Process *process = (struct Lisp_Process *)p;
   int fd = process->infd;
 
@@ -6977,8 +6984,7 @@
       if (err == EWOULDBLOCK)
         {
           /* Set a small timeout.  */
-         timeout.tv_sec = 1;
-         timeout.tv_usec = 0;
+         timeout = make_emacs_time (1, 0);
           FD_ZERO (&fdset);
           FD_SET ((int)fd, &fdset);
 

=== modified file 'src/w32.h'
--- a/src/w32.h 2012-10-07 22:31:58 +0000
+++ b/src/w32.h 2012-10-17 19:02:44 +0000
@@ -146,6 +146,28 @@
 extern Lisp_Object QCloaded_from;
 extern HMODULE w32_delayed_load (Lisp_Object);
 
+extern void init_environment (char **);
+extern void check_windows_init_file (void);
+extern void syms_of_ntproc (void);
+extern void syms_of_ntterm (void);
+extern void dostounix_filename (register char *);
+extern void unixtodos_filename (register char *);
+extern BOOL init_winsock (int load_now);
+extern void srandom (int);
+extern int random (void);
+
+extern int sys_pipe (int *);
+
+extern void set_process_dir (char *);
+extern int sys_spawnve (int, char *, char **, char **);
+extern void register_child (int, int);
+
+extern void sys_sleep (int);
+extern char *getwd (char *);
+extern int sys_link (const char *, const char *);
+
+
+
 #ifdef HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 

=== modified file 'src/w32proc.c'
--- a/src/w32proc.c     2012-10-08 12:53:18 +0000
+++ b/src/w32proc.c     2012-10-17 19:02:44 +0000
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <ctype.h>
 #include <io.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -68,8 +69,6 @@
 
 Lisp_Object Qhigh, Qlow;
 
-typedef void (_CALLBACK_ *signal_handler) (int);
-
 /* Signal handlers...SIG_DFL == 0 so this is initialized correctly.  */
 static signal_handler sig_handlers[NSIG];
 

=== modified file 'src/w32term.h'
--- a/src/w32term.h     2012-10-08 12:53:18 +0000
+++ b/src/w32term.h     2012-10-17 19:02:44 +0000
@@ -681,6 +681,9 @@
 
 extern void w32_sys_ring_bell (struct frame *f);
 extern void x_delete_display (struct w32_display_info *dpyinfo);
+extern void w32_initialize_display_info (Lisp_Object);
+extern void initialize_w32_display (struct terminal *);
+
 
 /* Keypad command key support.  W32 doesn't have virtual keys defined
    for the function keys on the keypad (they are mapped to the standard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]