Browse Source

Bugfix: No endian.h on Windows

Luke Dashjr 13 years ago
parent
commit
a0c6a9f8c0
3 changed files with 12 additions and 2 deletions
  1. 0 1
      cgminer.c
  2. 12 0
      miner.h
  3. 0 1
      uthash.h

+ 0 - 1
cgminer.c

@@ -15,7 +15,6 @@
 #include <curses.h>
 #include <curses.h>
 #endif
 #endif
 
 
-#include <endian.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>

+ 12 - 0
miner.h

@@ -125,6 +125,18 @@ void *alloca (size_t);
 #endif
 #endif
 #endif /* !defined(__GLXBYTEORDER_H__) */
 #endif /* !defined(__GLXBYTEORDER_H__) */
 
 
+#ifdef WIN32
+  #ifndef __LITTLE_ENDIAN
+    #define __LITTLE_ENDIAN 1234
+    #define __BIG_ENDIAN    4321
+  #endif
+  #ifndef __BYTE_ORDER
+    #define __BYTE_ORDER __LITTLE_ENDIAN
+  #endif
+#else
+  #include <endian.h>
+#endif
+
 /* This assumes htobe32 is a macro in endian.h */
 /* This assumes htobe32 is a macro in endian.h */
 #ifndef htobe32
 #ifndef htobe32
 # if __BYTE_ORDER == __LITTLE_ENDIAN
 # if __BYTE_ORDER == __LITTLE_ENDIAN

+ 0 - 1
uthash.h

@@ -24,7 +24,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef UTHASH_H
 #ifndef UTHASH_H
 #define UTHASH_H
 #define UTHASH_H
 
 
-#include <endian.h>
 #include <string.h>   /* memcmp,strlen */
 #include <string.h>   /* memcmp,strlen */
 #include <stddef.h>   /* ptrdiff_t */
 #include <stddef.h>   /* ptrdiff_t */
 #include <stdlib.h>   /* exit() */
 #include <stdlib.h>   /* exit() */