]> git.xonotic.org Git - xonotic/d0_blind_id.git/commitdiff
win32 build fixes
authorRudolf Polzer <divverent@alientrap.org>
Mon, 26 Jul 2010 12:24:53 +0000 (14:24 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 26 Jul 2010 12:24:53 +0000 (14:24 +0200)
main.c
sha2.h

diff --git a/main.c b/main.c
index 3363ec1de5f3809b78f2811aaa819c7917dee1f8..ef192054e972735ca28dd48fae45d24cc180e66b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -35,7 +35,9 @@ void bench(double *b)
        lastclock = b;
 }
 
+#ifndef WIN32
 #include <sys/signal.h>
+#endif
 volatile BOOL quit = 0;
 void mysignal(int signo)
 {
@@ -43,7 +45,16 @@ void mysignal(int signo)
        quit = 1;
 }
 
-#include <err.h>
+#include <stdarg.h>
+#include <stdlib.h>
+static void errx(int status, const char *format, ...)
+{
+       va_list ap;
+       va_start(ap, format);
+       vfprintf(stderr, format, ap);
+       exit(status);
+}
+
 int main(int argc, char **argv)
 {
        char buf[65536]; size_t bufsize;
@@ -76,7 +87,9 @@ int main(int argc, char **argv)
                errx(3, "readpub fail");
        */
 
+#ifndef WIN32
        signal(SIGINT, mysignal);
+#endif
 
        int n = 0;
        double bench_gen = 0, bench_fp = 0, bench_stop = 0;
diff --git a/sha2.h b/sha2.h
index 618a6f32b00d5918bc375c0cf78bbcca723b1207..0f4a9e7aee9251b418f00adef455bab6c7a95dec 100644 (file)
--- a/sha2.h
+++ b/sha2.h
 extern "C" {
 #endif
 
+#ifdef WIN32
+# define SHA2_USE_INTTYPES_H
+# define LITTLE_ENDIAN 1234
+# define BIG_ENDIAN    4321
+# define BYTE_ORDER LITTLE_ENDIAN 
+#else
+# define SHA2_USE_INTTYPES_H
+#endif
 
 /*
  * Import u_intXX_t size_t type definitions from system headers.  You