remove endian macros

This commit is contained in:
Joseph Poirier 2015-06-10 14:49:34 -05:00
parent 3655278bcd
commit b5207c06ae
3 changed files with 6 additions and 14 deletions

View file

@ -15,14 +15,14 @@ void LibraryInit(Picoc *pc)
/* define the version number macro */ /* define the version number macro */
pc->VersionString = TableStrRegister(pc, PICOC_VERSION); pc->VersionString = TableStrRegister(pc, PICOC_VERSION);
VariableDefinePlatformVar(pc, NULL, "PICOC_VERSION", pc->CharPtrType, (union AnyValue *)&pc->VersionString, false); VariableDefinePlatformVar(pc, NULL, "PICOC_VERSION", pc->CharPtrType, (union AnyValue*)&pc->VersionString, false);
/* define endian-ness macros */ /* define endian-ness macros */
BigEndian = ((*(char*)&__ENDIAN_CHECK__) == 0); BigEndian = ((*(char*)&__ENDIAN_CHECK__) == 0);
LittleEndian = ((*(char*)&__ENDIAN_CHECK__) == 1); LittleEndian = ((*(char*)&__ENDIAN_CHECK__) == 1);
VariableDefinePlatformVar(pc, NULL, "BIG_ENDIAN", &pc->IntType, (union AnyValue *)&BigEndian, false); VariableDefinePlatformVar(pc, NULL, "BIG_ENDIAN", &pc->IntType, (union AnyValue*)&BigEndian, false);
VariableDefinePlatformVar(pc, NULL, "LITTLE_ENDIAN", &pc->IntType, (union AnyValue *)&LittleEndian, false); VariableDefinePlatformVar(pc, NULL, "LITTLE_ENDIAN", &pc->IntType, (union AnyValue*)&LittleEndian, false);
} }
/* add a library */ /* add a library */

View file

@ -80,11 +80,11 @@ void UnistdFchdir(struct ParseState *Parser, struct Value *ReturnValue, struct V
void UnistdFdatasync(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) void UnistdFdatasync(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
{ {
#ifndef F_FULLSYNC #ifdef F_FULLSYNC
ReturnValue->Val->Integer = fdatasync(Param[0]->Val->Integer);
#else
/* Mac OS X equivalent */ /* Mac OS X equivalent */
ReturnValue->Val->Integer = fcntl(Param[0]->Val->Integer, F_FULLFSYNC); ReturnValue->Val->Integer = fcntl(Param[0]->Val->Integer, F_FULLFSYNC);
#else
ReturnValue->Val->Integer = fdatasync(Param[0]->Val->Integer);
#endif #endif
} }

View file

@ -30,9 +30,6 @@
#undef DEBUG_LEXER #undef DEBUG_LEXER
#undef DEBUG_VAR_SCOPE #undef DEBUG_VAR_SCOPE
/* set based on the platform */
#undef BIG_ENDIAN
#if defined(__hppa__) || defined(__sparc__) #if defined(__hppa__) || defined(__sparc__)
#define ALIGN_TYPE double /* the default data type to use for alignment */ #define ALIGN_TYPE double /* the default data type to use for alignment */
@ -40,10 +37,6 @@
#define ALIGN_TYPE void * /* the default data type to use for alignment */ #define ALIGN_TYPE void * /* the default data type to use for alignment */
#endif #endif
#if defined(__powerpc__) || defined(__hppa__) || defined(__sparc__)
#define BIG_ENDIAN
#endif
#define GLOBAL_TABLE_SIZE (97) /* global variable table */ #define GLOBAL_TABLE_SIZE (97) /* global variable table */
#define STRING_TABLE_SIZE (97) /* shared string table size */ #define STRING_TABLE_SIZE (97) /* shared string table size */
#define STRING_LITERAL_TABLE_SIZE (97) /* string literal table size */ #define STRING_LITERAL_TABLE_SIZE (97) /* string literal table size */
@ -58,7 +51,6 @@
#define INTERACTIVE_PROMPT_LINE " > " #define INTERACTIVE_PROMPT_LINE " > "
/* host platform includes */ /* host platform includes */
#ifdef UNIX_HOST #ifdef UNIX_HOST
# include <stdint.h> # include <stdint.h>