all: add "nm-std-aux/nm-default-std.h" as replacement for "nm-default.h"
autotools projects commonly should include "config.h" as first header. Also, commonly we need more headers, like glib.h or our nm_auto macros. Hence, almost all our sources should as first include "nm-default.h". However, as we build different parts, "nm-default.h" gets controlled by the NETWORKMANAGER_COMPILATION define which autotools/meson needs to specify in the build options. That is confusing. One advantage of that was, that theoretically the same sources can be built twice, with different behavior. However, we should avoid doing that altogether and build static libraries (once) that we link multiple times. Another advantage was that if NETWORKMANAGER_COMPILATION is for example set to build a DAEMON source, there is a check that we don't include private headers from libnm-core. However, that should be better solved by not having public, internal and private headers in the same directory. Instead, introduce different "nm-default-*.h" headers that don't require special defines and behave in a consistent way. This way, we require fewer CFLAGS and it's immediately clear by looking at the source alone which headers are included. Also, you will be easier see when a wrong nm-default-*.h header gets included. Introduce the first replacement. The others will follow.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "nm-default.h"
|
||||
#include "nm-default-std.h"
|
||||
|
||||
#include "nm-std-utils.h"
|
||||
|
||||
|
Reference in New Issue
Block a user