sim: add checks to core headers to prevent incorrect common building

Some of the core sim headers rely on the SIM_AC_OPTION_BITSIZE macro
which can change the size of core types.  Since these haven't been
unified across ports, add checks to make sure they aren't accidentally
included when building for all ports.  This caught the sim-load file
using poisoned headers that it didn't actually need.
This commit is contained in:
Mike Frysinger 2021-11-28 14:25:36 -05:00
parent 6688220490
commit e9307449c3
3 changed files with 8 additions and 2 deletions

View File

@ -23,6 +23,9 @@
#ifndef SIM_CONFIG_H
#define SIM_CONFIG_H
#ifdef SIM_COMMON_BUILD
#error "This header is unusable in common builds due to reliance on SIM_AC_OPTION_BITSIZE"
#endif
/* Host dependant:

View File

@ -27,12 +27,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <time.h>
#include "sim-basics.h"
#include "bfd.h"
#include "sim-utils.h"
#include "sim/callback.h"
#include "sim/sim.h"
#include "sim-utils.h"
static void eprintf (host_callback *, const char *, ...);
static void xprintf (host_callback *, const char *, ...);

View File

@ -23,6 +23,10 @@
#ifndef SIM_TYPES_H
#define SIM_TYPES_H
#ifdef SIM_COMMON_BUILD
#error "This header is unusable in common builds due to reliance on SIM_AC_OPTION_BITSIZE"
#endif
#include <stdint.h>
/* INTEGER QUANTITIES: