aboutsummaryrefslogtreecommitdiffstats
path: root/heimdall/source/Heimdall.h
diff options
context:
space:
mode:
Diffstat (limited to 'heimdall/source/Heimdall.h')
-rw-r--r--heimdall/source/Heimdall.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/heimdall/source/Heimdall.h b/heimdall/source/Heimdall.h
index d0194a5..205f01d 100644
--- a/heimdall/source/Heimdall.h
+++ b/heimdall/source/Heimdall.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2013 Benjamin Dobell, Glass Echidna
+/* Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -21,21 +21,36 @@
#ifndef HEIMDALL_H
#define HEIMDALL_H
-#include "../config.h"
-
-#ifdef OS_WINDOWS
+#ifdef _MSC_VER // Microsoft Visual C Standard Library
#include <Windows.h>
#undef GetBinaryType
-#else
+#ifndef va_copy
+#define va_copy(d, s) ((d) = (s))
+#endif
+
+#define FileOpen(FILE, MODE) fopen(FILE, MODE)
+#define FileClose(FILE) fclose(FILE)
+#define FileSeek(FILE, OFFSET, ORIGIN) _fseeki64(FILE, OFFSET, ORIGIN)
+#define FileTell(FILE) _ftelli64(FILE)
+#define FileRewind(FILE) rewind(FILE)
+
+#else // POSIX Standard Library
+
+#ifdef AUTOCONF
+#include "../config.h"
+#endif
-#if defined(OS_DARWIN) || defined(OS_LINUX)
#include <unistd.h>
+
#define Sleep(t) usleep(1000*t)
-#else
-#error operating system not supported
-#endif
+
+#define FileOpen(FILE, MODE) fopen(FILE, MODE)
+#define FileClose(FILE) fclose(FILE)
+#define FileSeek(FILE, OFFSET, ORIGIN) fseeko(FILE, OFFSET, ORIGIN)
+#define FileTell(FILE) ftello(FILE)
+#define FileRewind(FILE) rewind(FILE)
#endif