From 03e86d000fee7f59e793f7367f9db510a209b30a Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 19 Feb 2018 14:09:10 +0200 Subject: [PATCH] Remove HAVE_CONFIG_H defs and uses Since GLib files are only meant to be built as part of GLib, config.h always exists, so the checks are more or less pointless. https://bugzilla.gnome.org/show_bug.cgi?id=793399 --- build/win32/vs8/glib.vcproj | 4 ++-- build/win32/vs8/gmodule.vcproj | 4 ++-- build/win32/vs8/gobject.vcproj | 4 ++-- build/win32/vs8/gthread.vcproj | 4 ++-- gio/inotify/meson.build | 2 +- gio/kqueue/meson.build | 2 +- gio/meson.build | 15 ++++++--------- .../gdbus-object-manager-example/meson.build | 2 +- gio/tests/meson.build | 1 - gio/win32/meson.build | 2 +- gio/xdgmime/meson.build | 2 +- gio/xdgmime/xdgmime.c | 2 -- gio/xdgmime/xdgmimealias.c | 2 -- gio/xdgmime/xdgmimecache.c | 2 -- gio/xdgmime/xdgmimeglob.c | 2 -- gio/xdgmime/xdgmimeicon.c | 2 -- gio/xdgmime/xdgmimeint.c | 2 -- gio/xdgmime/xdgmimemagic.c | 2 -- gio/xdgmime/xdgmimeparent.c | 2 -- glib/gnulib/asnprintf.c | 4 +--- glib/gnulib/printf-parse.c | 4 +--- glib/gnulib/printf.c | 4 +--- glib/meson.build | 7 ++----- glib/pcre/Makefile.am | 1 - glib/pcre/pcre_byte_order.c | 2 -- glib/pcre/pcre_chartables.c | 2 -- glib/pcre/pcre_compile.c | 2 -- glib/pcre/pcre_config.c | 2 -- glib/pcre/pcre_dfa_exec.c | 2 -- glib/pcre/pcre_exec.c | 2 -- glib/pcre/pcre_fullinfo.c | 2 -- glib/pcre/pcre_get.c | 2 -- glib/pcre/pcre_globals.c | 2 -- glib/pcre/pcre_jit_compile.c | 2 -- glib/pcre/pcre_newline.c | 2 -- glib/pcre/pcre_ord2utf8.c | 2 -- glib/pcre/pcre_string_utils.c | 2 -- glib/pcre/pcre_study.c | 2 -- glib/pcre/pcre_tables.c | 2 -- glib/pcre/pcre_valid_utf8.c | 2 -- glib/pcre/pcre_version.c | 2 -- glib/pcre/pcre_xclass.c | 2 -- glib/tests/hash.c | 4 +--- glib/tests/meson.build | 2 +- gobject/meson.build | 1 - gobject/tests/meson.build | 4 ++-- tests/meson.build | 2 +- win32/vs10/glib-build-defines.props | 2 +- win32/vs9/glib-build-defines.vsprops | 2 +- 49 files changed, 31 insertions(+), 100 deletions(-) diff --git a/build/win32/vs8/glib.vcproj b/build/win32/vs8/glib.vcproj index 00d6efffd..de358764f 100644 --- a/build/win32/vs8/glib.vcproj +++ b/build/win32/vs8/glib.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../..;../../../glib;../../../../dependencies/proxy-libintl-20080418/include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GLIB_COMPILATION;DLL_EXPORT;HAVE_CONFIG_H;G_LOG_DOMAIN=\"Glib\";G_ENABLE_DEBUG;G_DISABLE_DEPRECATED;PCRE_STATIC;LINK_SIZE=2;MAX_NAME_SIZE=32;MAX_NAME_COUNT=10000;NEWLINE=-1;POSIX_MALLOC_THRESHOLD=10;MATCH_LIMIT=10000000;MATCH_LIMIT_RECURSION=10000000" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GLIB_COMPILATION;DLL_EXPORT;G_LOG_DOMAIN=\"Glib\";G_ENABLE_DEBUG;G_DISABLE_DEPRECATED;PCRE_STATIC;LINK_SIZE=2;MAX_NAME_SIZE=32;MAX_NAME_COUNT=10000;NEWLINE=-1;POSIX_MALLOC_THRESHOLD=10;MATCH_LIMIT=10000000;MATCH_LIMIT_RECURSION=10000000" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -125,7 +125,7 @@ . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmime.h" #include "xdgmimeint.h" diff --git a/gio/xdgmime/xdgmimealias.c b/gio/xdgmime/xdgmimealias.c index 5bc70c347..bf95bc0d3 100644 --- a/gio/xdgmime/xdgmimealias.c +++ b/gio/xdgmime/xdgmimealias.c @@ -23,9 +23,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmimealias.h" #include "xdgmimeint.h" diff --git a/gio/xdgmime/xdgmimecache.c b/gio/xdgmime/xdgmimecache.c index 1bcaf48e4..eab6119b6 100644 --- a/gio/xdgmime/xdgmimecache.c +++ b/gio/xdgmime/xdgmimecache.c @@ -22,9 +22,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include diff --git a/gio/xdgmime/xdgmimeglob.c b/gio/xdgmime/xdgmimeglob.c index 1d4fbc40d..c18762e9a 100644 --- a/gio/xdgmime/xdgmimeglob.c +++ b/gio/xdgmime/xdgmimeglob.c @@ -23,9 +23,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmimeglob.h" #include "xdgmimeint.h" diff --git a/gio/xdgmime/xdgmimeicon.c b/gio/xdgmime/xdgmimeicon.c index 603d041e4..272b06268 100644 --- a/gio/xdgmime/xdgmimeicon.c +++ b/gio/xdgmime/xdgmimeicon.c @@ -22,9 +22,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmimeicon.h" #include "xdgmimeint.h" diff --git a/gio/xdgmime/xdgmimeint.c b/gio/xdgmime/xdgmimeint.c index e1e9b4d99..d56bb8340 100644 --- a/gio/xdgmime/xdgmimeint.c +++ b/gio/xdgmime/xdgmimeint.c @@ -23,9 +23,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmimeint.h" #include diff --git a/gio/xdgmime/xdgmimemagic.c b/gio/xdgmime/xdgmimemagic.c index 051d727a8..51be9722b 100644 --- a/gio/xdgmime/xdgmimemagic.c +++ b/gio/xdgmime/xdgmimemagic.c @@ -23,9 +23,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include "xdgmimemagic.h" diff --git a/gio/xdgmime/xdgmimeparent.c b/gio/xdgmime/xdgmimeparent.c index 8b38b83b3..e87bf5513 100644 --- a/gio/xdgmime/xdgmimeparent.c +++ b/gio/xdgmime/xdgmimeparent.c @@ -23,9 +23,7 @@ * License along with this library; if not, see . */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "xdgmimeparent.h" #include "xdgmimeint.h" diff --git a/glib/gnulib/asnprintf.c b/glib/gnulib/asnprintf.c index 10a8d38d0..0fdab2fba 100644 --- a/glib/gnulib/asnprintf.c +++ b/glib/gnulib/asnprintf.c @@ -14,9 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "g-gnulib.h" diff --git a/glib/gnulib/printf-parse.c b/glib/gnulib/printf-parse.c index eab4b57ae..64bb8be2d 100644 --- a/glib/gnulib/printf-parse.c +++ b/glib/gnulib/printf-parse.c @@ -27,9 +27,7 @@ STATIC Set to 'static' to declare the function static. ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "g-gnulib.h" diff --git a/glib/gnulib/printf.c b/glib/gnulib/printf.c index 66261b8f1..242740a9d 100644 --- a/glib/gnulib/printf.c +++ b/glib/gnulib/printf.c @@ -22,9 +22,7 @@ * GLib at ftp://ftp.gtk.org/pub/gtk/. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include #include diff --git a/glib/meson.build b/glib/meson.build index add29d06e..9df77b6f9 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -255,31 +255,28 @@ if host_system == 'windows' executable('gspawn-win32-helper', 'gspawn-win32-helper.c', install : true, gui_app : true, - c_args : ['-DHAVE_CONFIG_H=1'], include_directories : configinc, dependencies : [libintl, libglib_dep]) executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c', install : true, - c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'], + c_args : ['-DHELPER_CONSOLE'], include_directories : configinc, dependencies : [libintl, libglib_dep]) else executable('gspawn-win64-helper', 'gspawn-win32-helper.c', install : true, gui_app : true, - c_args : ['-DHAVE_CONFIG_H=1'], include_directories : configinc, dependencies : [libintl, libglib_dep]) executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c', install : true, - c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'], + c_args : ['-DHELPER_CONSOLE'], include_directories : configinc, dependencies : [libintl, libglib_dep]) endif else gtester = executable('gtester', 'gtester.c', install : true, - c_args : ['-DHAVE_CONFIG_H=1'], include_directories : configinc, dependencies : [libglib_dep]) endif diff --git a/glib/pcre/Makefile.am b/glib/pcre/Makefile.am index 0787f9210..8f0bae66b 100644 --- a/glib/pcre/Makefile.am +++ b/glib/pcre/Makefile.am @@ -4,7 +4,6 @@ noinst_LTLIBRARIES += libpcre.la libpcre_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"GLib-GRegex\" \ - -DHAVE_CONFIG_H \ -DHAVE_MEMMOVE \ -DSUPPORT_UCP \ -DSUPPORT_UTF \ diff --git a/glib/pcre/pcre_byte_order.c b/glib/pcre/pcre_byte_order.c index 6ac8325b6..4f21433c1 100644 --- a/glib/pcre/pcre_byte_order.c +++ b/glib/pcre/pcre_byte_order.c @@ -43,9 +43,7 @@ see if it was compiled with the opposite endianness. If so, it uses an auxiliary local function to flip the appropriate bytes. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_chartables.c b/glib/pcre/pcre_chartables.c index 2a39e9ff3..293b16b32 100644 --- a/glib/pcre/pcre_chartables.c +++ b/glib/pcre/pcre_chartables.c @@ -20,9 +20,7 @@ and dead code stripping is activated. This leads to link errors. Pulling in the header ensures that the array gets flagged as "someone outside this compilation unit might reference this" and so it will always be supplied to the linker. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_compile.c b/glib/pcre/pcre_compile.c index d0ed8fbed..12e09c4ef 100644 --- a/glib/pcre/pcre_compile.c +++ b/glib/pcre/pcre_compile.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. supporting internal functions that are not used by other modules. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #define NLBLOCK cd /* Block containing newline information */ #define PSSTART start_pattern /* Field containing processed string start */ diff --git a/glib/pcre/pcre_config.c b/glib/pcre/pcre_config.c index aa0ef867b..34719591f 100644 --- a/glib/pcre/pcre_config.c +++ b/glib/pcre/pcre_config.c @@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. /* This module contains the external function pcre_config(). */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif /* Keep the original link size. */ static int real_link_size = LINK_SIZE; diff --git a/glib/pcre/pcre_dfa_exec.c b/glib/pcre/pcre_dfa_exec.c index f8c887fb3..9cc82323d 100644 --- a/glib/pcre/pcre_dfa_exec.c +++ b/glib/pcre/pcre_dfa_exec.c @@ -72,9 +72,7 @@ in others, so I abandoned this code. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #define NLBLOCK md /* Block containing newline information */ #define PSSTART start_subject /* Field containing processed string start */ diff --git a/glib/pcre/pcre_exec.c b/glib/pcre/pcre_exec.c index cecbbcf9d..4ba3eda01 100644 --- a/glib/pcre/pcre_exec.c +++ b/glib/pcre/pcre_exec.c @@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. pattern matching using an NFA algorithm, trying to mimic Perl as closely as possible. There are also some static supporting functions. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #define NLBLOCK md /* Block containing newline information */ #define PSSTART start_subject /* Field containing processed string start */ diff --git a/glib/pcre/pcre_fullinfo.c b/glib/pcre/pcre_fullinfo.c index 7a7db110d..2fe785a13 100644 --- a/glib/pcre/pcre_fullinfo.c +++ b/glib/pcre/pcre_fullinfo.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. information about a compiled pattern. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_get.c b/glib/pcre/pcre_get.c index 3d9904e88..61147efe8 100644 --- a/glib/pcre/pcre_get.c +++ b/glib/pcre/pcre_get.c @@ -43,9 +43,7 @@ from the subject string after a regex match has succeeded. The original idea for these functions came from Scott Wimer. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_globals.c b/glib/pcre/pcre_globals.c index 534660c77..383ec7311 100644 --- a/glib/pcre/pcre_globals.c +++ b/glib/pcre/pcre_globals.c @@ -52,9 +52,7 @@ a local function is used. Also, when compiling for Virtual Pascal, things are done differently, and global variables are not used. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_jit_compile.c b/glib/pcre/pcre_jit_compile.c index acb7ea22a..d7233832f 100644 --- a/glib/pcre/pcre_jit_compile.c +++ b/glib/pcre/pcre_jit_compile.c @@ -40,9 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_newline.c b/glib/pcre/pcre_newline.c index a0a13c8ed..ddd7708fa 100644 --- a/glib/pcre/pcre_newline.c +++ b/glib/pcre/pcre_newline.c @@ -47,9 +47,7 @@ and NLTYPE_ANY. The full list of Unicode newline characters is taken from http://unicode.org/unicode/reports/tr18/. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_ord2utf8.c b/glib/pcre/pcre_ord2utf8.c index b12da327a..71fd587e0 100644 --- a/glib/pcre/pcre_ord2utf8.c +++ b/glib/pcre/pcre_ord2utf8.c @@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. /* This file contains a private PCRE function that converts an ordinal character value into a UTF8 string. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_string_utils.c b/glib/pcre/pcre_string_utils.c index 54a75f6c0..38cc2f958 100644 --- a/glib/pcre/pcre_string_utils.c +++ b/glib/pcre/pcre_string_utils.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. class. It is used by both pcre_exec() and pcre_def_exec(). */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_study.c b/glib/pcre/pcre_study.c index acb531bdf..ee0930718 100644 --- a/glib/pcre/pcre_study.c +++ b/glib/pcre/pcre_study.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. supporting functions. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_tables.c b/glib/pcre/pcre_tables.c index b580a4a73..abcc96ef4 100644 --- a/glib/pcre/pcre_tables.c +++ b/glib/pcre/pcre_tables.c @@ -45,9 +45,7 @@ uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name clashes with the library. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_valid_utf8.c b/glib/pcre/pcre_valid_utf8.c index fc626b70b..cecaf347f 100644 --- a/glib/pcre/pcre_valid_utf8.c +++ b/glib/pcre/pcre_valid_utf8.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. strings. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_version.c b/glib/pcre/pcre_version.c index 58a0eaa26..3dd60a5bc 100644 --- a/glib/pcre/pcre_version.c +++ b/glib/pcre/pcre_version.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. string that identifies the PCRE version that is in use. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/pcre/pcre_xclass.c b/glib/pcre/pcre_xclass.c index e5a55d7bc..89ad09f54 100644 --- a/glib/pcre/pcre_xclass.c +++ b/glib/pcre/pcre_xclass.c @@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. class. It is used by both pcre_exec() and pcre_def_exec(). */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "pcre_internal.h" diff --git a/glib/tests/hash.c b/glib/tests/hash.c index 160ba4f56..0513d6558 100644 --- a/glib/tests/hash.c +++ b/glib/tests/hash.c @@ -26,9 +26,7 @@ #undef G_DISABLE_ASSERT #undef G_LOG_DOMAIN -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include diff --git a/glib/tests/meson.build b/glib/tests/meson.build index 5ff885170..4ac3620b8 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -96,7 +96,7 @@ test_env = [ 'MALLOC_PERTURB_=@0@'.format(random_number % 256), ] -test_cargs = ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib"'] +test_cargs = ['-DG_LOG_DOMAIN="GLib"'] # Tests that consistently time out on the CI infrastructure slow_tests = [ diff --git a/gobject/meson.build b/gobject/meson.build index f58cfb297..f1ab8fd46 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -98,7 +98,6 @@ endforeach executable('gobject-query', 'gobject-query.c', install : true, - c_args : ['-DHAVE_CONFIG_H=1'], dependencies : [libglib_dep, libgobject_dep]) install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index 3d99ef332..88eba19ae 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -38,7 +38,7 @@ foreach test_name : gobject_tests test_name = 'gobject-private' endif exe = executable(test_name, test_src, - c_args : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'], + c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'], dependencies : deps, ) test(test_name, exe, env : test_env) @@ -74,7 +74,7 @@ marshalers_c = custom_target('marshalers_c', exe = executable('signals', 'signals.c', marshalers_h, marshalers_c, - c_args : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'], + c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'], dependencies : deps, ) test('signals', exe, env : test_env) diff --git a/tests/meson.build b/tests/meson.build index 552178271..03997a634 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -7,7 +7,7 @@ test_env = [ 'MALLOC_CHECK_=2', ] -test_cargs = ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib"'] +test_cargs = ['-DG_LOG_DOMAIN="GLib"'] subdir('gobject') subdir('refcount') diff --git a/win32/vs10/glib-build-defines.props b/win32/vs10/glib-build-defines.props index b87e22c55..86314a8c3 100644 --- a/win32/vs10/glib-build-defines.props +++ b/win32/vs10/glib-build-defines.props @@ -27,7 +27,7 @@ ..\..;..\..\glib;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories) - HAVE_CONFIG_H;%(PreprocessorDefinitions) + %(PreprocessorDefinitions) msvc_recommended_pragmas.h;%(ForcedIncludeFiles) true /d2Zi+ %(AdditionalOptions) diff --git a/win32/vs9/glib-build-defines.vsprops b/win32/vs9/glib-build-defines.vsprops index 36fce8667..cccf36fe7 100644 --- a/win32/vs9/glib-build-defines.vsprops +++ b/win32/vs9/glib-build-defines.vsprops @@ -10,7 +10,7 @@