changeset 229:e7f363452178

patch from Fridrich Strba for undefined ENDIAN
author Carl Byington <carl@five-ten-sg.com>
date Fri, 04 Sep 2009 08:06:22 -0700
parents be1009c92ac2
children 42b38d65f7e4
files src/common.h src/define.h
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/common.h	Thu Sep 03 15:16:53 2009 -0700
+++ b/src/common.h	Fri Sep 04 08:06:22 2009 -0700
@@ -23,7 +23,6 @@
 	typedef long long          int64_t;
 #endif
 
-
 #ifndef _WIN32
     typedef struct {
         uint32_t  dwLowDateTime;
@@ -34,6 +33,15 @@
     #include <sys/param.h>
 #else
     #include <windows.h>
+#endif
+
+#if defined(_WIN32) || defined(__DJGPP__)
+    #ifndef LITTLE_ENDIAN
+        #define LITTLE_ENDIAN 1234
+    #endif
+    #ifndef BIG_ENDIAN
+        #define BIG_ENDIAN 4321
+    #endif
     #define BYTE_ORDER LITTLE_ENDIAN
 #endif
 
--- a/src/define.h	Thu Sep 03 15:16:53 2009 -0700
+++ b/src/define.h	Fri Sep 04 08:06:22 2009 -0700
@@ -92,12 +92,13 @@
     #include <process.h>
     #undef gmtime_r
     #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
-    #define ctime_r(tp,tmp) (ctime(tp)?(strcpy((tmp),ctime((tp))),(tmp)):0) 
+    #define ctime_r(tp,tmp) (ctime(tp)?(strcpy((tmp),ctime((tp))),(tmp)):0)
 #else
     #ifdef __DJGPP__
         #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
         #define ctime_r(tp,tmp) (ctime(tp)?(strcpy((tmp),ctime((tp))),(tmp)):0)
 		#define fseeko(stream, offset, whence) fseek(stream, (long)offset, whence)
+        #define ftello ftell
     #endif
     #ifdef HAVE_UNISTD_H
         #include <unistd.h>