Fixes include poisoning on sonoma

This commit is contained in:
Fredrik Andersson 2024-04-16 20:12:00 +02:00
parent 1ed09307a7
commit d55d90a9e5
3 changed files with 18 additions and 24 deletions

View File

@ -194,28 +194,6 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
#undef fread_unlocked
#undef fwrite_unlocked
/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
the ctype macros through safe-ctype.h */
#ifdef __cplusplus
#ifdef INCLUDE_STRING
# include <string>
#endif
#endif
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
replacement instead. */
#include "safe-ctype.h"
#include <sys/types.h>
#include <errno.h>
#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
extern int errno;
#endif
#ifdef __cplusplus
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
@ -229,6 +207,11 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
the ctype macros through safe-ctype.h */
#ifdef INCLUDE_STRING
# include <string>
#endif
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
@ -245,6 +228,17 @@ extern int errno;
# include <type_traits>
#endif
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
replacement instead. */
#include "safe-ctype.h"
#include <sys/types.h>
#include <errno.h>
#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
extern int errno;
#endif
/* Some of glibc's string inlines cause warnings. Plus we'd rather
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES

View File

@ -31,6 +31,7 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#define INCLUDE_VECTOR
#define INCLUDE_MEMORY
#include "gcc-plugin.h"
#include "system.h"
@ -69,7 +70,6 @@
#include "gcc-c-interface.h"
#include "context.hh"
#include <vector>
using namespace cc1_plugin;

View File

@ -33,6 +33,7 @@
#undef PACKAGE_VERSION
#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@ -71,7 +72,6 @@
#include "rpc.hh"
#include "context.hh"
#include <vector>
using namespace cc1_plugin;