From: Rudolf Polzer Date: Mon, 26 Jul 2010 12:24:53 +0000 (+0200) Subject: win32 build fixes X-Git-Tag: xonotic-v0.1.0preview~38^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=444df3ea8eb483e3597112e243dc414a55c43c2c;p=xonotic%2Fd0_blind_id.git win32 build fixes --- diff --git a/main.c b/main.c index 3363ec1..ef19205 100644 --- a/main.c +++ b/main.c @@ -35,7 +35,9 @@ void bench(double *b) lastclock = b; } +#ifndef WIN32 #include +#endif volatile BOOL quit = 0; void mysignal(int signo) { @@ -43,7 +45,16 @@ void mysignal(int signo) quit = 1; } -#include +#include +#include +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 618a6f3..0f4a9e7 100644 --- a/sha2.h +++ b/sha2.h @@ -39,6 +39,14 @@ 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