mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
Make it possible to use "inline" and "restrict"
Put the appropriate machinery in place to be able to use the "inline" and "restrict" keywords with appropriate semantics.
This commit is contained in:
parent
51997d3d44
commit
253a4e7a9f
2 changed files with 16 additions and 2 deletions
16
compiler.h
16
compiler.h
|
|
@ -22,7 +22,17 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
/* autoconf doesn't define these if they are redundant, but we want to
|
||||
be able to #ifdef them... */
|
||||
#else
|
||||
/* Default these to unsupported unless we have config.h */
|
||||
# ifndef inline
|
||||
# define inline
|
||||
# endif
|
||||
# ifndef restrict
|
||||
# define restrict
|
||||
# endif
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
/* This is required to get the standard <inttypes.h> macros when compiling
|
||||
with a C++ compiler. This must be defined *before* <inttypes.h> is
|
||||
|
|
@ -71,7 +81,9 @@ int vsnprintf(char *, size_t, const char *, va_list);
|
|||
# ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
# else
|
||||
typedef enum { false, true } bool;
|
||||
/* This is sort of dangerous, since casts will behave different than
|
||||
casting to the standard boolean type. Always use !!, not (bool). */
|
||||
typedef enum bool { false, true } bool;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ AC_CHECK_HEADERS(stdbool.h)
|
|||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_RESTRICT
|
||||
AC_TYPE_SIZE_T
|
||||
AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),AC_DEFINE(WORDS_LITTLEENDIAN))
|
||||
AH_TEMPLATE(WORDS_BIGENDIAN,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue