[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master db677f5: Fix compilation warnings on MS-Windows
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master db677f5: Fix compilation warnings on MS-Windows |
Date: |
Mon, 10 Oct 2016 16:23:34 +0000 (UTC) |
branch: master
commit db677f5dfedc0a665211d1113251e77a01e5d5e3
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix compilation warnings on MS-Windows
* src/w32.c (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT): Remove
definitions of these macros, which seem to be unneeded and cause
compiler warnings.
* src/fileio.c (NOMINMAX): Avoid compiler warnings about unused
macros.
* src/firstfile.c (dummy_main_reference): Rename from 'dummy' and
make it external, to avoid compiler warning.
---
src/fileio.c | 4 ++++
src/firstfile.c | 4 ++--
src/w32.c | 9 ---------
3 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/src/fileio.c b/src/fileio.c
index 8f16d1e..6026d8e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -60,6 +60,10 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. */
#ifdef WINDOWSNT
#define NOMINMAX 1
#include <windows.h>
+/* The redundant #ifdef is to avoid compiler warning about unused macro. */
+#ifdef NOMINMAX
+#undef NOMINMAX
+#endif
#include <sys/file.h>
#include "w32.h"
#endif /* not WINDOWSNT */
diff --git a/src/firstfile.c b/src/firstfile.c
index 188d4f8..962d6f6 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -26,7 +26,7 @@ char my_begbss[1]; /* Do not initialize this variable. */
static char _my_begbss[1];
char * my_begbss_static = _my_begbss;
-/* Add a dummy reference to ensure emacs.obj is linked in. */
+/* Add a dummy reference to ensure emacs.o is linked in. */
extern int main (int, char **);
-static int (*dummy) (int, char **) = main;
+int (*dummy_main_reference) (int, char **) = main;
#endif
diff --git a/src/w32.c b/src/w32.c
index 517e286..ad7d94a 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -94,13 +94,6 @@ extern void dynlib_reset_last_error (void);
#include <pwd.h>
#include <grp.h>
-/* MinGW64 defines these in its _mingw.h. */
-#ifndef _ANONYMOUS_UNION
-# define _ANONYMOUS_UNION
-#endif
-#ifndef _ANONYMOUS_STRUCT
-# define _ANONYMOUS_STRUCT
-#endif
#include <windows.h>
/* Some versions of compiler define MEMORYSTATUSEX, some don't, so we
use a different name to avoid compilation problems. */
@@ -282,8 +275,6 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *,
SELECT_TYPE *,
struct timespec *, void *);
extern int sys_dup (int);
-
-
/* Initialization states.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master db677f5: Fix compilation warnings on MS-Windows,
Eli Zaretskii <=