[Liboil] MinGW fix

Stephane Fillod f8cfe at free.fr
Sat Dec 10 13:58:36 PST 2005


Hi,

MinGW has the following prototype for swab (in string.h):

  _CRTIMP void __cdecl     swab (const char*, char*, size_t); 

hence the patch herebelow is needed for portability:


diff -u -b -B -w -p -r1.2 swab.c
--- liboil/c/swab.c     6 Dec 2005 18:33:38 -0000       1.2
+++ liboil/c/swab.c     10 Dec 2005 21:54:43 -0000
@@ -34,12 +34,13 @@
 #include <liboil/liboilclasses.h>

 #include <unistd.h>
+#include <string.h>


 static void
 swab_u16_libc (uint16_t *d, uint16_t *s, int n)
 {
-  swab (s, d, n*2);
+  swab ((const void*)s, (void*)d, n*2);
 }
 OIL_DEFINE_IMPL (swab_u16_libc, swab_u16);


Rem: some systems not have string.h

-- 
Stephane


More information about the Liboil mailing list