[vlc-devel] [PATCH 4/4] stream_filter: fix compilation on OS/2

KO Myung-Hun komh78 at gmail.com
Mon Sep 7 08:56:42 CEST 2015


On OS/2, mmap() is declared in stdio.h wrongly. Prevent it.

-----
  CC       stream_filter/prefetch.lo
stream_filter/prefetch.c:40:7: error: expected identifier or '(' before 'void'
     ((void)(a), (void)(l), (void)(d), (void)(o), errno = ENOMEM, MAP_FAILED)
       ^
stream_filter/prefetch.c:40:12: error: expected ')' before '(' token
     ((void)(a), (void)(l), (void)(d), (void)(o), errno = ENOMEM, MAP_FAILED)
            ^
stream_filter/prefetch.c: In function 'Open':
stream_filter/prefetch.c:42:42: warning: right-hand operand of comma expression has no effect [-Wunused-value]
     ((void)(a), (void)(l), errno = EINVAL, -1)
                                          ^
stream_filter/prefetch.c:575:9: note: in expansion of macro 'munmap'
         munmap(sys->buffer, 2 * sys->buffer_size);
         ^
stream_filter/prefetch.c: In function 'Close':
stream_filter/prefetch.c:42:42: warning: right-hand operand of comma expression has no effect [-Wunused-value]
     ((void)(a), (void)(l), errno = EINVAL, -1)
                                          ^
stream_filter/prefetch.c:605:5: note: in expansion of macro 'munmap'
     munmap(sys->buffer, 2 * sys->buffer_size);
     ^
-----
---
 modules/stream_filter/prefetch.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c
index 42085c3..aa6d4ce 100644
--- a/modules/stream_filter/prefetch.c
+++ b/modules/stream_filter/prefetch.c
@@ -46,6 +46,11 @@
 #include <windows.h>
 #endif
 
+#ifdef __OS2__
+/* Prevent mmap() declaration in stdio.h on OS/2 */
+# define _MMAP_DECLARED
+#endif
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_stream.h>
-- 
1.9.5



More information about the vlc-devel mailing list