]> granicus.if.org Git - graphviz/commitdiff
Fixed Wundef warnings in ast_common.h.in
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 11 Jul 2016 18:38:39 +0000 (20:38 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Fri, 22 Jul 2016 12:26:04 +0000 (14:26 +0200)
There were several Wundef warnings in ast_common.h.in. Because this file is included in a lot of other files, these warnings showed up often. This change fixed 1119 warnings in total.

ast_common.h.in

index 88affebbd4b232424d6301c172e4d1e993c9b1b6..558f6177aa4777ad2adf0c913e3279c0cf57f92a 100644 (file)
 /* */
 
 /* __STD_C indicates that the language is ANSI-C or C++ */
-#if !defined(__STD_C) && __STDC__
+#if !defined(__STD_C) && defined(__STDC__)
 #define __STD_C         1
 #endif
-#if !defined(__STD_C) && (__cplusplus || c_plusplus)
+#if !defined(__STD_C) && (defined(__cplusplus) || defined(c_plusplus))
 #define __STD_C         1
 #endif
 #if !defined(__STD_C) && _proto_stdc
@@ -96,7 +96,7 @@
 
 /* extern symbols must be protected against C++ name mangling */
 #ifndef _BEGIN_EXTERNS_
-#  if __cplusplus || c_plusplus
+#  if defined(__cplusplus) || defined(c_plusplus)
 #    define _BEGIN_EXTERNS_ extern "C" {
 #    define _END_EXTERNS_   }
 #  else
 
 /* dynamic linked library external scope handling */
 #undef extern
-#if _dll_import && !defined(__EXPORT__) && _DLL_BLD
+#if defined(_dll_import) && !defined(__EXPORT__) && _DLL_BLD
 #define __EXPORT__      __declspec(dllexport)
 #endif
-#if _dll_import && !defined(__IMPORT__)
+#if defined(_dll_import) && !defined(__IMPORT__)
 #define __IMPORT__      __declspec(dllimport)
 #endif
 #if !defined(_astimport)
 #endif
 #endif /*_astimport*/
 
-#if !_DLL_BLD && _dll_import
+#if !defined(_DLL_BLD) && defined(_dll_import)
 #define __EXTERN__(T,obj)       extern T obj; T* _imp__ ## obj = &obj
 #define __DEFINE__(T,obj,val)   T obj = val; T* _imp__ ## obj = &obj
 #else
 #endif
 
 #ifndef _AST_STD_H
-#       if _hdr_stddef
+#       if defined(_hdr_stddef)
 #       include <stddef.h>
 #       endif
-#       if _hdr_stdarg
+#       if defined(_hdr_stdarg)
 #       include <stdarg.h>
 #       endif
-#       if _hdr_varargs
+#       if defined(_hdr_varargs)
 #       include <varargs.h>
 #       endif
-#       if _sys_types
+#       if defined(_sys_types)
 #       include <sys/types.h>
 #       endif
 #endif