Attempt to autoconfiscate gcc_struct.

It seems some tool-chains get rather picky about such things.
This commit is contained in:
Bill Currie 2014-02-03 16:47:51 +09:00
parent d1a8c1b277
commit 3fb9fb9373
2 changed files with 20 additions and 2 deletions

View file

@ -45,7 +45,7 @@ AC_TRY_COMPILE(
AC_MSG_RESULT(no)
)
AH_VERBATIM([HAVE___ATTRIBUTE__VISIBILITY],
[/* Define this if the GCC __attribute__ keyword is available */
[/* Define this if the GCC visibility __attribute__ is available */
#undef HAVE___ATTRIBUTE__VISIBILITY
#ifdef HAVE___ATTRIBUTE__VISIBILITY
# define VISIBLE __attribute__((visibility ("default")))
@ -53,6 +53,24 @@ AH_VERBATIM([HAVE___ATTRIBUTE__VISIBILITY],
# define VISIBLE
#endif])
AC_MSG_CHECKING(for __attribute__ ((gcc_struct)))
AC_TRY_COMPILE(
[void foo (void);
typedef struct { int foo; } __attribute__ ((gcc_struct)) gcc_struct_test;],
[],
AC_DEFINE(HAVE___ATTRIBUTE__GCC_STRUCT)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
AH_VERBATIM([HAVE___ATTRIBUTE__GCC_STRUCT],
[/* Define this if the GCC gcc_struct __attribute__ is available */
#undef HAVE___ATTRIBUTE__GCC_STRUCT
#ifdef HAVE___ATTRIBUTE__GCC_STRUCT
# define GCC_STRUCT __attribute__((gcc_struct))
#else
# define GCC_STRUCT
#endif])
AC_MSG_CHECKING(for __builtin_expect)
AC_TRY_COMPILE(
[long (*foo) (long, long) = __builtin_expect;],

View file

@ -314,7 +314,7 @@ void PR_Opcode_Init (void);
typedef struct dstatement_s {
pr_opcode_e op:16;
pr_ushort_t a,b,c;
} __attribute__((gcc_struct)) dstatement_t;
} GCC_STRUCT dstatement_t;
typedef struct ddef_s {
pr_ushort_t type; // if DEF_SAVEGLOBGAL bit is set