improving portability to Mac OS
fixes for big endian architectures (PowerPC) renaming exported symbol raise to fl_raise fixing some bugs and oversights discovered in the process
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ TARGET = libllt.a
|
||||
TESTSRC = unittest.c
|
||||
TESTER = llttest
|
||||
|
||||
FLAGS = -Wall -Wextra -Wno-strict-aliasing $(CFLAGS)
|
||||
FLAGS = -Wall -Wno-strict-aliasing $(CFLAGS)
|
||||
LIBS =
|
||||
|
||||
DEBUGFLAGS = -g -DDEBUG $(FLAGS)
|
||||
|
||||
+2
-1
@@ -8,6 +8,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <malloc.h>
|
||||
#include <sys/timeb.h>
|
||||
@@ -23,7 +25,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "dtypes.h"
|
||||
#include "dirpath.h"
|
||||
|
||||
void get_cwd(char *buf, size_t size)
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ typedef u_int32_t uint32_t;
|
||||
typedef u_int64_t uint64_t;
|
||||
typedef u_ptrint_t uptrint_t;
|
||||
|
||||
#define ALIGN(x, sz) (((x) + (sz-1)) & (-sz))
|
||||
#define LLT_ALIGN(x, sz) (((x) + (sz-1)) & (-sz))
|
||||
|
||||
// branch prediction annotations
|
||||
#ifdef __GNUC__
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <wchar.h>
|
||||
#include <stdio.h> // for printf
|
||||
|
||||
#include "dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <malloc.h>
|
||||
#include <io.h>
|
||||
@@ -20,7 +22,6 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include "dtypes.h"
|
||||
#include "utils.h"
|
||||
#include "utf8.h"
|
||||
#include "ios.h"
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ static void *aligned_ptr(char *ptr, size_t align_size)
|
||||
char *ptr2, *aligned_ptr;
|
||||
|
||||
ptr2 = ptr + sizeof(long);
|
||||
aligned_ptr = (char*)ALIGN(((uptrint_t)ptr2), align_size);
|
||||
aligned_ptr = (char*)LLT_ALIGN(((uptrint_t)ptr2), align_size);
|
||||
|
||||
((long*)aligned_ptr)[-1] = (long)(aligned_ptr - ptr);
|
||||
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "ieee754.h"
|
||||
#include "dtypes.h"
|
||||
#include "ieee754.h"
|
||||
#include "utils.h"
|
||||
#include "random.h"
|
||||
#include "timefuncs.h"
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "dtypes.h"
|
||||
|
||||
#if defined(MACOSX) || defined(MACINTEL)
|
||||
#include <sys/time.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "socket.h"
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -8,6 +8,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <malloc.h>
|
||||
#include <sys/timeb.h>
|
||||
@@ -18,7 +20,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "dtypes.h"
|
||||
#include "timefuncs.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#include "dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <malloc.h>
|
||||
#define snprintf _snprintf
|
||||
|
||||
Reference in New Issue
Block a user