From 6df01ab8ab8509b04f86d7da069ec2d25eb31bf9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 1 May 2021 18:05:23 -0400 Subject: sim: switch config.h usage to defs.h The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise. --- sim/erc32/ChangeLog | 6 ++++++ sim/erc32/erc32.c | 4 +++- sim/erc32/exec.c | 4 +++- sim/erc32/float.c | 4 +++- sim/erc32/func.c | 4 +++- sim/erc32/help.c | 4 +++- sim/erc32/interf.c | 4 +++- sim/erc32/sis.c | 4 +++- sim/erc32/sis.h | 1 - 9 files changed, 27 insertions(+), 8 deletions(-) (limited to 'sim/erc32') diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index 40dd931..355880e 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/ChangeLog @@ -1,5 +1,11 @@ 2021-05-16 Mike Frysinger + * erc32.c, exec.c, float.c, func.c, help.c, interf.c, sis.c: Replace + config.h include with defs.h. + * sis.h: Delete config.h include. + +2021-05-16 Mike Frysinger + * config.in, configure: Regenerate. 2021-05-14 Mike Frysinger diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c index a93b62b..747ac78 100644 --- a/sim/erc32/erc32.c +++ b/sim/erc32/erc32.c @@ -18,7 +18,9 @@ /* The control space devices */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include #include #include diff --git a/sim/erc32/exec.c b/sim/erc32/exec.c index 8daf759..d8a8c6c 100644 --- a/sim/erc32/exec.c +++ b/sim/erc32/exec.c @@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include "sis.h" #include #include diff --git a/sim/erc32/float.c b/sim/erc32/float.c index 6d3d2bd..d2ae397 100644 --- a/sim/erc32/float.c +++ b/sim/erc32/float.c @@ -26,7 +26,9 @@ 4. Clear host exception bits. */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include "sis.h" #include diff --git a/sim/erc32/func.c b/sim/erc32/func.c index 52428e4..ff53f3b 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include #include #include diff --git a/sim/erc32/help.c b/sim/erc32/help.c index 419ab0d..211de52 100644 --- a/sim/erc32/help.c +++ b/sim/erc32/help.c @@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include #include "sis.h" diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c index c199dab..28c981b 100644 --- a/sim/erc32/interf.c +++ b/sim/erc32/interf.c @@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include #include #include diff --git a/sim/erc32/sis.c b/sim/erc32/sis.c index 05044c3..749d256 100644 --- a/sim/erc32/sis.c +++ b/sim/erc32/sis.c @@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" +/* This must come before any other includes. */ +#include "defs.h" + #include #include #include diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h index 10c500f..7f787cf 100644 --- a/sim/erc32/sis.h +++ b/sim/erc32/sis.h @@ -13,7 +13,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "config.h" #include "ansidecl.h" #include "sim/callback.h" #include "sim/sim.h" -- cgit v1.1