]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fixed more warnings
authorDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:18:04 +0000 (11:18 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:18:04 +0000 (11:18 -0400)
Makefile
gmqcc.h

index 4ff71b44687ba2f7236078e0b68594073a4ac9e3..a0d6cc98cf27a37292e82a5ecd7fefb862328e80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,17 +3,16 @@ CFLAGS += -Wall -I. -pedantic-errors -std=c90
 
 #turn on tons of warnings if clang is present
 ifeq ($(CC), clang)
-       CFLAGS += \
-               -Weverything \
-               -Wno-missing-prototypes \
-               -Wno-unused-parameter \
-               -Wno-sign-compare \
-               -Wno-implicit-fallthrough \
-               -Wno-sign-conversion \
-               -Wno-conversion \
+       CFLAGS +=                  \
+               -Weverything                  \
+               -Wno-missing-prototypes       \
+               -Wno-unused-parameter         \
+               -Wno-sign-compare             \
+               -Wno-implicit-fallthrough     \
+               -Wno-sign-conversion          \
+               -Wno-conversion               \
                -Wno-disabled-macro-expansion \
-               -Wno-padded \
-               -Wno-undef \
+               -Wno-padded                   \
                -Wno-format-nonliteral
 
 endif
diff --git a/gmqcc.h b/gmqcc.h
index 78acf4a50bf9146cee47a972cbca3b62ae27ce90..3fc52c6a0627ac21a70c81c2de28fa43670801dc 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
 #   endif /* !true  */
 #   define false (0)
 #   define true  (1)
-#   if __STDC_VERSION__ < 199901L && __GNUC__ < 3
-        typedef int  _Bool
+#   ifdef __STDC_VERSION__
+#       if __STDC_VERSION__ < 199901L && __GNUC__ < 3
+            typedef int  bool;
+#       else
+            typedef _Bool bool;
+#       endif
 #   else
-        typedef _Bool bool;
-#   endif
-#   endif /* !__cplusplus */
+        typedef int bool;
+#   endif /* !__STDC_VERSION__ */
+#endif    /* !__cplusplus      */
 
 /*
  * Of some functions which are generated we want to make sure
  * like gcc and clang might have an inline attribute we can
  * use if present.
  */
-#if __STDC_VERSION__ < 199901L
-#   if defined(__GNUC__) || defined (__CLANG__)
-#       if __GNUC__ < 2
-#           define GMQCC_INLINE
+#ifdef __STDC_VERSION__
+#    if __STDC_VERSION__ < 199901L
+#       if defined(__GNUC__) || defined (__CLANG__)
+#           if __GNUC__ < 2
+#               define GMQCC_INLINE
+#           else
+#               define GMQCC_INLINE __attribute__ ((always_inline))
+#           endif
 #       else
-#           define GMQCC_INLINE __attribute__ ((always_inline))
+#           define GMQCC_INLINE
 #       endif
-#   else
-#       define GMQCC_INLINE
-#   endif
+#    else
+#       define GMQCC_INLINE inline
+#    endif
 #else
-#   define GMQCC_INLINE inline
-#endif
+#    define GMQCC_INLINE
+#endif /* !__STDC_VERSION__ */
 
 /*
  * noreturn is present in GCC and clang