From e0fe8421fbe73f26e6349063aaf98c3cdc783713 Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Mon, 29 Aug 2016 22:16:59 +0200 Subject: [PATCH] Resolved "macro redefinition" warnings. On Windows, the Linux build does not throw this warning, the warning C4005 "macro redefinition" is thrown several hundered times. Most of these could be prepended by an `#undef`, this resolves the warning. --- lib/cdt/cdt.h | 2 ++ lib/common/pointset.h | 1 + lib/gvc/gvc.h | 1 + lib/gvc/gvio.h | 1 + lib/vmalloc/vmalloc.h | 1 + windows/include/FEATURE/vmalloc | 26 ++++++++++++++++++++++++++ windows/include/ast_common.h | 24 ++++++++++++++++++++++++ windows/include/config.h | 1 + 8 files changed, 57 insertions(+) diff --git a/lib/cdt/cdt.h b/lib/cdt/cdt.h index 2829f6879..fa3111cc1 100644 --- a/lib/cdt/cdt.h +++ b/lib/cdt/cdt.h @@ -27,6 +27,8 @@ #endif #ifdef WIN32 +#undef __EXPORT__ +#undef __IMPORT__ #define __EXPORT__ __declspec (dllexport) #define __IMPORT__ __declspec (dllimport) #endif diff --git a/lib/common/pointset.h b/lib/common/pointset.h index 701a354b4..1e9f9045f 100644 --- a/lib/common/pointset.h +++ b/lib/common/pointset.h @@ -32,6 +32,7 @@ extern "C" { /*visual studio*/ #ifdef WIN32 #ifndef GVC_EXPORTS +#undef extern #define extern __declspec(dllimport) #endif #endif diff --git a/lib/gvc/gvc.h b/lib/gvc/gvc.h index 5e08e96e1..c1a08a488 100644 --- a/lib/gvc/gvc.h +++ b/lib/gvc/gvc.h @@ -30,6 +30,7 @@ extern "C" { /*visual studio*/ #ifdef WIN32 #ifndef GVC_EXPORTS +#undef extern #define extern __declspec(dllimport) #endif #endif diff --git a/lib/gvc/gvio.h b/lib/gvc/gvio.h index 9620d5102..b6d125831 100644 --- a/lib/gvc/gvio.h +++ b/lib/gvc/gvio.h @@ -29,6 +29,7 @@ extern "C" { /*visual studio*/ #ifdef WIN32 #ifndef GVC_EXPORTS +#undef extern #define extern __declspec(dllimport) #endif #endif diff --git a/lib/vmalloc/vmalloc.h b/lib/vmalloc/vmalloc.h index d0fc27b42..9295f253c 100644 --- a/lib/vmalloc/vmalloc.h +++ b/lib/vmalloc/vmalloc.h @@ -111,6 +111,7 @@ extern "C" { /*visual studio*/ #ifdef WIN32 +#undef extern #ifndef VMALLOC_EXPORTS #define extern __declspec(dllimport) #else diff --git a/windows/include/FEATURE/vmalloc b/windows/include/FEATURE/vmalloc index 4b34f26e6..abfa84d78 100644 --- a/windows/include/FEATURE/vmalloc +++ b/windows/include/FEATURE/vmalloc @@ -1,17 +1,43 @@ /* : : generated from ../../lib/vmalloc/features/vmalloc by iffe version 2004-08-11 : : */ #ifndef _def_atexit_vmalloc #define _def_atexit_vmalloc 1 + +#undef _sys_types #define _sys_types 1 /* #include ok */ + +#undef _lib_atexit #define _lib_atexit 1 /* atexit() in default lib(s) */ + +#undef _lib_getpagesize #define _lib_getpagesize 0 /* getpagesize() in default lib(s) */ + +#undef _hdr_stdlib #define _hdr_stdlib 1 /* #include ok */ + +#undef _sys_stat #define _sys_stat 1 /* #include ok */ + +#undef _hdr_time #define _hdr_time 1 /* #include ok */ + +#undef _sys_time #define _sys_time 1 /* #include ok */ + +#undef _hdr_stddef #define _hdr_stddef 1 /* #include ok */ + +#undef _typ_ssize_t #define _typ_ssize_t 1 /* ssize_t is a type */ + +#undef _hdr_malloc #define _hdr_malloc 1 /* #include ok */ + +#undef _hdr_malloc #define _lib_alloca 1 /* alloca exists */ + +#undef _mal_alloca #define _mal_alloca 1 /* alloca is based on malloc() */ + +#undef _stk_down #define _stk_down 1 /* stack grows downward */ #endif diff --git a/windows/include/ast_common.h b/windows/include/ast_common.h index 43a88e45d..0c891a761 100644 --- a/windows/include/ast_common.h +++ b/windows/include/ast_common.h @@ -14,16 +14,38 @@ /* : : generated from features/common by iffe version 1999-08-11 : : */ #ifndef _AST_COMMON_H #define _AST_COMMON_H 1 + +#undef _hdr_pthread #define _hdr_pthread 1 /* #include ok */ + +#undef _hdr_stddef #define _hdr_stddef 1 /* #include ok */ + +#undef _sys_types #define _sys_types 1 /* #include ok */ + +#undef _hdr_time #define _hdr_time 1 /* #include ok */ + +#undef _sys_time #define _sys_time 0 /* #include ok */ + +#undef _sys_times #define _sys_times 0 /* #include ok */ + +#undef _hdr_stdlib #define _hdr_stdlib 0 /* #include ok */ + +#undef _typ_size_t #define _typ_size_t 1 /* size_t is a type */ + +#undef _typ_ssize_t #define _typ_ssize_t 0 /* ssize_t is a type */ + +#undef _typ_long_double #define _typ_long_double 1 /* long double is a type */ + +#undef _proto_stdc #define _proto_stdc 1 /* Standard-C prototypes ok */ /* __STD_C indicates that the language is ANSI-C or C++ */ @@ -108,10 +130,12 @@ # endif #endif #if !_typ_size_t +# undef _typ_size_t # define _typ_size_t 1 typedef int size_t; #endif #if !_typ_ssize_t +# undef _typ_ssize_t # define _typ_ssize_t 1 typedef int ssize_t; #endif diff --git a/windows/include/config.h b/windows/include/config.h index 93819a1d2..92aa6bf1e 100644 --- a/windows/include/config.h +++ b/windows/include/config.h @@ -175,6 +175,7 @@ #define HAVE_GTKGLEXT 1 /* Define if you have the gts library */ +#undef HAVE_GTS #define HAVE_GTS 0 /* Define if you have the iconv() function. */ -- 2.40.0