]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add -Wc++-compat flag and fix its sole warning. This *should* be safe.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Jun 2020 03:21:07 +0000 (03:21 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Jun 2020 03:21:07 +0000 (03:21 +0000)
Famous last words...

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12752 d7cf8633-e32d-0410-b094-e92efae38249

image_png.c
makefile

index da327de29c22f2361be6ad2afad5cef70b002130..7ef74f9a54a1f1445e65246e9cbb0c4b0d32fbd4 100644 (file)
@@ -511,7 +511,6 @@ qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height,
 
        // NOTE: this relies on jmp_buf being the first thing in the png structure
        // created by libpng! (this is correct for libpng 1.2.x)
-#ifdef __cplusplus
 #ifdef WIN64
        if (setjmp((_JBTYPE *)png))
 #elif defined(MACOSX) || defined(WIN32)
@@ -519,10 +518,7 @@ qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height,
 #elif defined(__ANDROID__)
        if (setjmp((long *)png))
 #else
-       if (setjmp((__jmp_buf_tag *)png))
-#endif
-#else
-       if (setjmp(png))
+       if (setjmp((struct __jmp_buf_tag *)png))
 #endif
        {
                qpng_destroy_write_struct(&png, &pnginfo);
index 4fb547a049f090942ee57d9097e7b93c45f4eccc..38550197ece1d5a3fd01227151934ff5356be0c9 100644 (file)
--- a/makefile
+++ b/makefile
@@ -217,7 +217,7 @@ ifeq ($(WIN64RELEASE), 1)
 #      WINDRES=$(TARGET)-windres
 endif
 
-CFLAGS_WARNINGS=-Wall -Wshadow -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
+CFLAGS_WARNINGS=-Wall -Werror=c++-compat -Wshadow -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
 
 
 ifeq ($(DP_MAKE_TARGET), mingw)