summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-11-02 16:19:42 +0100
committerThomas Haller <thaller@redhat.com>2021-06-10 21:29:33 +0200
commit818fa1a686164b5cf14f46b5d15e2426bd18a1de (patch)
tree5b034c01e384ee0940613ae533b4d52ee3a7883d
parent3e1255fbfbc5951e415c78336bdd0cc34a0f5c84 (diff)
shared: don't enforce unset G_LOG_DOMAIN in "nm-default.h"
When including <glib.h>, it will always define G_LOG_DOMAIN if it is not yet defined. Usually we want to include "nm-default.h" as very first header. In that case, <glib.h> is not yet included. Then the previous check #error works well. However, if we include "nm-default.h" in sources generated by glib-mkenums, then the generator first already includes <glib.h>, and thus defines G_LOG_DOMAIN. It does so for "libnm-core/nm-core-enum-types.c" and "libnm/nm-enum-types.c", where the #error would not trigger. But we will also include "nm-default.h" for "libnm-core/tests/nm-core-tests-enum-types.c". That will start triggering this #error. While in general we want to include "nm-default.h" first, we also need to support cases where <glib.h> gets included first. Thus this error is not useful. Remove it. (cherry picked from commit 42fa8f3d2722dd9fa987b95919f8dd42d23f0367) (cherry picked from commit a1f3cebbec68022f4665dc29aff1b58ef116c2c8) (cherry picked from commit 61d78ed3337d1682ea1ee255a0f7334e0b633342) (cherry picked from commit 33113c718827a261ce1da74e4c6fa06b97f70b6a) (cherry picked from commit cefe7456fdbcccd2204dfa1b2638d70764879278) (cherry picked from commit 2bfa92a4c6cfcd2d761b8187d186fc12a7b5fe39)
-rw-r--r--shared/nm-default.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/shared/nm-default.h b/shared/nm-default.h
index 54e9916733..beac8b4a98 100644
--- a/shared/nm-default.h
+++ b/shared/nm-default.h
@@ -104,8 +104,6 @@
#else
#error Need to define G_LOG_DOMAIN
#endif
-#elif defined (NETWORKMANAGER_COMPILATION_TEST) || (NETWORKMANAGER_COMPILATION & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON)
-#error Do not define G_LOG_DOMAIN with NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON
#endif
/*****************************************************************************/