]> git.sesse.net Git - vlc/commitdiff
Win32: try to fix build on some Mingw versions
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 22 Oct 2012 15:24:39 +0000 (18:24 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 22 Oct 2012 15:24:39 +0000 (18:24 +0300)
compat/flockfile.c

index f0b61bb070eef1133a59f09c81c32f74b5ad2cd4..6d6c936631cc9d30f13c7c301908ff38101206c9 100644 (file)
 #  warning Broken SDK: VLC logs will be garbage.
 #  define _lock_file(s) ((void)(s))
 #  define _unlock_file(s) ((void)(s))
+#  undef _getc_nolock
+#  define _getc_nolock(s) getc(s)
+#  undef _putc_nolock
+#  define _putc_nolock(s,c) putc(s,c)
 # endif
 
 void flockfile (FILE *stream)
@@ -52,21 +56,21 @@ int getc_unlocked (FILE *stream)
     return _getc_nolock (stream);
 }
 
-int getchar_unlocked (void)
+int putc_unlocked (int c, FILE *stream)
 {
-    return _getchar_nolock ();
+    return _putc_nolock (c, stream);
 }
 
-int putc_unlocked (int c, FILE *stream)
+#else
+# error flockfile not implemented on your platform!
+#endif
+
+int getchar_unlocked (void)
 {
-    return _putc_nolock (c, stream);
+    return getc_unlocked (stdin);
 }
 
 int putchar_unlocked (int c)
 {
-    return _putchar_nolock (c);
+    return putc_unlocked (c, stdout);
 }
-
-#else
-# error flockfile not implemented on your platform!
-#endif