From c485764cd4d94f272538d7228373fb039f427265 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 8 Oct 2018 20:42:42 +0900 Subject: [PATCH] Replaced _BSD_SOURCE, _SVID_SOURCE, _GNU_SOURCE with _DEFAULT_SOURCE. Signed-off-by: Michele Calgaro --- mkspecs/cygwin-g++/qplatformdefs.h | 18 ++---------------- mkspecs/hurd-g++/qplatformdefs.h | 18 ++---------------- mkspecs/linux-clang/qplatformdefs.h | 18 ++---------------- mkspecs/linux-cxx/qplatformdefs.h | 18 ++---------------- mkspecs/linux-ecc-64/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++-32/qplatformdefs.h | 25 ++----------------------- mkspecs/linux-g++-64/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++-sparc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-g++/qplatformdefs.h | 18 ++---------------- mkspecs/linux-icc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-kcc/qplatformdefs.h | 18 ++---------------- mkspecs/linux-kylix/qplatformdefs.h | 18 ++---------------- mkspecs/linux-pgcc/qplatformdefs.h | 18 ++---------------- src/3rdparty/libpng/pngconf.h | 22 ---------------------- src/moc/moc_yacc.cpp | 2 +- 15 files changed, 27 insertions(+), 238 deletions(-) diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index bc04a69..5a4f5e6 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index bf750e5..9f5b15f 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif diff --git a/mkspecs/linux-clang/qplatformdefs.h b/mkspecs/linux-clang/qplatformdefs.h index 42a0e47..15bb469 100644 --- a/mkspecs/linux-clang/qplatformdefs.h +++ b/mkspecs/linux-clang/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-cxx/qplatformdefs.h +++ b/mkspecs/linux-cxx/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-ecc-64/qplatformdefs.h +++ b/mkspecs/linux-ecc-64/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-32/qplatformdefs.h b/mkspecs/linux-g++-32/qplatformdefs.h index e25bc1e..fcf7631 100644 --- a/mkspecs/linux-g++-32/qplatformdefs.h +++ b/mkspecs/linux-g++-32/qplatformdefs.h @@ -1,26 +1,5 @@ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H - -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-64/qplatformdefs.h b/mkspecs/linux-g++-64/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-g++-64/qplatformdefs.h +++ b/mkspecs/linux-g++-64/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++-sparc/qplatformdefs.h b/mkspecs/linux-g++-sparc/qplatformdefs.h index 42a0e47..15bb469 100644 --- a/mkspecs/linux-g++-sparc/qplatformdefs.h +++ b/mkspecs/linux-g++-sparc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h index 42a0e47..15bb469 100644 --- a/mkspecs/linux-g++/qplatformdefs.h +++ b/mkspecs/linux-g++/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-icc/qplatformdefs.h b/mkspecs/linux-icc/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-icc/qplatformdefs.h +++ b/mkspecs/linux-icc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h index 9df75e3..7811a12 100644 --- a/mkspecs/linux-kcc/qplatformdefs.h +++ b/mkspecs/linux-kcc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-kylix/qplatformdefs.h b/mkspecs/linux-kylix/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-kylix/qplatformdefs.h +++ b/mkspecs/linux-kylix/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h index e25bc1e..2bf855b 100644 --- a/mkspecs/linux-pgcc/qplatformdefs.h +++ b/mkspecs/linux-pgcc/qplatformdefs.h @@ -5,22 +5,8 @@ #include "qglobal.h" -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -// DNS system header files are a mess! -// includes . is using -// 'u_char' and includes . Now the problem is that -// defines 'u_char' only if __USE_BSD is defined. -// __USE_BSD is defined in if _BSD_SOURCE is defined. -#ifndef _BSD_SOURCE -# define _BSD_SOURCE -#endif - -// 1) need to reset default environment if _BSD_SOURCE is defined -// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 -// 3) it seems older glibc need this to include the X/Open stuff -#ifndef _GNU_SOURCE -# define _GNU_SOURCE +#ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE #endif #include diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h index bd5d1c4..19ccaf1 100644 --- a/src/3rdparty/libpng/pngconf.h +++ b/src/3rdparty/libpng/pngconf.h @@ -246,30 +246,8 @@ #endif #ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - */ - -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - __png.h__ already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ - /* include setjmp.h for error handling */ # include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ #endif /* PNG_SETJMP_SUPPORTED */ #ifdef BSD diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index bf152b3..2ab0be7 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -2112,7 +2112,7 @@ yystrlen (yystr) # endif # ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# if defined __GLIBC__ && defined _STRING_H && defined _DEFAULT_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in