summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2012-05-20 20:33:10 +0400
committerAndrey Nazarov <skuller@skuller.net>2012-05-20 20:33:10 +0400
commit37877d1583d8ff752c649cb876862930528d062d (patch)
tree3697cea03e3ae500cf4ca479afe1b3bf40fb9d55 /src
parentd953ad0a6285ce78bb82dec05597c94c0f7a77a5 (diff)
Fix compilation issues with MinGW-w64.
Diffstat (limited to 'src')
-rw-r--r--src/files.c5
-rw-r--r--src/win_local.h8
2 files changed, 11 insertions, 2 deletions
diff --git a/src/files.c b/src/files.c
index b853c6a..800e19f 100644
--- a/src/files.c
+++ b/src/files.c
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
+#include <direct.h>
#else
#include <unistd.h>
#endif
@@ -43,8 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define os_stat(p, s) _stat(p, s)
#define os_fstat(f, s) _fstat(f, s)
#define os_fileno(f) _fileno(f)
-#define Q_ISREG(m) _S_ISREG(m)
-#define Q_ISDIR(m) _S_ISDIR(m)
+#define Q_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#define Q_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
typedef struct _stat os_stat_t;
#else
#define os_mkdir(p) mkdir(p, 0775)
diff --git a/src/win_local.h b/src/win_local.h
index 24b5bcd..da5b1e8 100644
--- a/src/win_local.h
+++ b/src/win_local.h
@@ -66,6 +66,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef const GUID *LPCGUID;
#endif
+// MinGW-w64 doesn't define these...
+#ifndef DM_GRAYSCALE
+#define DM_GRAYSCALE 1
+#endif
+#ifndef DM_INTERLACED
+#define DM_INTERLACED 2
+#endif
+
typedef struct {
HWND wnd;
HDC dc;