[vlc-devel] [PATCH v3 06/19] newlib/nacl: Provide flockfile implementation

Dennis Hamester dhamester at jusst.de
Mon Mar 20 17:57:23 CET 2017


From: Julian Scheel <julian at jusst.de>

newlib provides an flockfile implementation via sys/io.h, which is
marked as internal. As we do not have a better alternative make use of
it here, albeit being marked as internal.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 compat/flockfile.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/compat/flockfile.c b/compat/flockfile.c
index afe8a3e111..bf78139f93 100644
--- a/compat/flockfile.c
+++ b/compat/flockfile.c
@@ -56,8 +56,20 @@ int putc_unlocked (int c, FILE *stream)
 }
 
 #else
+#ifdef __native_client__
+void flockfile (FILE *stream)
+{
+    _flockfile(stream);
+}
+
+void funlockfile (FILE *stream)
+{
+    _funlockfile(stream);
+}
+#else
 # error flockfile not implemented on your platform!
 #endif
+#endif
 
 int getchar_unlocked (void)
 {
-- 
2.12.0



More information about the vlc-devel mailing list