[easytag: 19/20] Fix redefinition warning in Windows compat code



commit ecf346d48f601c5c1c42a772338bef5f34ef2e99
Author: David King <amigadave amigadave com>
Date:   Fri Feb 6 17:31:35 2015 +0000

    Fix redefinition warning in Windows compat code
    
    Only define a custom mkstemp() or truncate() if the functions are not
    available.

 src/win32/win32dep.c |    4 ++++
 src/win32/win32dep.h |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/win32/win32dep.c b/src/win32/win32dep.c
index 09b2176..10f4151 100644
--- a/src/win32/win32dep.c
+++ b/src/win32/win32dep.c
@@ -124,6 +124,7 @@ weasytag_locale_dir (void)
 }
 
 /* Miscellaneous */
+#ifndef HAVE_MKSTEMP
 /* emulate the unix function */
 gint
 et_w32_mkstemp (gchar *template)
@@ -138,6 +139,7 @@ et_w32_mkstemp (gchar *template)
 
     return fd;
 }
+#endif /* !HAVE_MKSTEMP */
 
 void
 str_replace_char (gchar *str, gchar in_char, gchar out_char)
@@ -189,6 +191,7 @@ ET_Win32_Get_Audio_File_Player (void)
     return g_strdup("");
 }
 
+#ifndef HAVE_TRUNCATE
 gint
 et_w32_truncate (const gchar *path, off_t length)
 {
@@ -208,5 +211,6 @@ et_w32_truncate (const gchar *path, off_t length)
 
     return ret;
 }
+#endif /* !HAVE_TRUNCATE */
 
 #endif /* G_OS_WIN32 */
diff --git a/src/win32/win32dep.h b/src/win32/win32dep.h
index eeac9a3..9c09544 100644
--- a/src/win32/win32dep.h
+++ b/src/win32/win32dep.h
@@ -34,6 +34,8 @@
 
 G_BEGIN_DECLS
 
+#include "config.h"
+
 #define lstat stat
 #define mkdir(a,b) mkdir(a)
 #define chown(a,b,c) 0
@@ -64,7 +66,7 @@ extern void  ET_Win32_Path_Replace_Slashes           (gchar *path);
 #ifndef HAVE_MKSTEMP
 #define et_w32_mkstemp mkstemp
 extern gint et_w32_mkstemp (char *template);
-#endif /* HAVE_MKSTEMP */
+#endif /* !HAVE_MKSTEMP */
 
 #ifndef HAVE_TRUNCATE
 #define et_w32_truncate truncate


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