1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Augment `OBJCODE_COOKIE' to detect wrong endianness or word size.

* libguile/objcodes.c (OBJCODE_ENDIANNESS, _OBJCODE_STRINGIFY,
  OBJCODE_STRINGIFY, OBJCODE_WORD_SIZE): New macros.
  (OBJCODE_COOKIE): Use them.  The intent is that `.go' files compiled
  for a different endianness or word size are detected.
This commit is contained in:
Ludovic Courtès 2009-07-15 00:55:33 +02:00
parent ba4c43dc3b
commit 9e1a18db9f

View file

@ -33,8 +33,22 @@
#include "programs.h"
#include "objcodes.h"
/* The endianness marker in objcode. */
#ifdef WORDS_BIGENDIAN
# define OBJCODE_ENDIANNESS "BE"
#else
# define OBJCODE_ENDIANNESS "LE"
#endif
#define _OBJCODE_STRINGIFY(x) # x
#define OBJCODE_STRINGIFY(x) _OBJCODE_STRINGIFY (x)
/* The word size marker in objcode. */
#define OBJCODE_WORD_SIZE OBJCODE_STRINGIFY (SIZEOF_VOID_P)
/* nb, the length of the header should be a multiple of 8 bytes */
#define OBJCODE_COOKIE "GOOF-0.6"
#define OBJCODE_COOKIE \
"GOOF-0.6-" OBJCODE_ENDIANNESS "-" OBJCODE_WORD_SIZE "---"
/*