[easytag/wip/mingw] Use ifdef for conditional mingw compilation



commit b75b181e1ab450552ff85cb7438da0484fbf4592
Author: David King <amigadave amigadave com>
Date:   Sat Apr 27 22:41:48 2013 +0100

    Use ifdef for conditional mingw compilation
    
    Avoid testing the build host in the Makefile and altering which files
    will be built based on it, and instead test for G_OS_WIN32 with ifdef.

 Makefile.am          |    7 +------
 src/win32/win32dep.c |    6 ++++++
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 8f157a0..a4fec44 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,11 +26,6 @@ easytag_CFLAGS = \
        $(WARN_CFLAGS) \
        $(EASYTAG_CFLAGS)
 
-if WINDOWS_HOST
-win32_sources = \
-       src/win32/win32dep.c
-endif
-
 easytag_SOURCES = \
        src/id3lib/c_wrapper.cpp \
        src/libapetag/apetaglib.c \
@@ -70,7 +65,7 @@ easytag_SOURCES = \
        src/vcedit.c \
        src/wavpack_header.c \
        src/wavpack_tag.c \
-       $(win32_sources)
+       src/win32/win32dep.c
 
 easytag_headers = \
        src/id3lib/id3_bugfix.h \
diff --git a/src/win32/win32dep.c b/src/win32/win32dep.c
index 89f2518..a842fb8 100644
--- a/src/win32/win32dep.c
+++ b/src/win32/win32dep.c
@@ -24,6 +24,10 @@
  *
  */
 
+#include "config.h"
+
+#ifdef G_OS_WIN32
+
 #include <winsock2.h>
 #include <windows.h>
 #include <io.h>
@@ -649,3 +653,5 @@ et_w32_ftruncate (gint fd, off_t length)
 
     return chsize ((gint)h, length);
 }
+
+#endif /* G_OS_WIN32 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]