changeset 5456:53c3c929c037

libbiosig: Don't include <sys/stat.h> in files that use "sopen" from libbiosig. * src/libbiosig-1-fixes.patch: Avoid including <sys/stat.h>, or "sopen" will be declared twice with conflicting type. * dist-files.mk: Include new file in list.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 11 Jun 2020 21:59:50 +0200
parents 8999910050be
children 970faba5e505
files dist-files.mk src/libbiosig-1-fixes.patch
diffstat 2 files changed, 97 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Thu Jun 11 08:16:05 2020 -0400
+++ b/dist-files.mk	Thu Jun 11 21:59:50 2020 +0200
@@ -217,6 +217,7 @@
   libarchive.mk \
   libass-test.c \
   libass.mk \
+  libbiosig-1-fixes.patch \
   libbiosig.mk \
   libcdio.mk \
   libcroco.mk \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/libbiosig-1-fixes.patch	Thu Jun 11 21:59:50 2020 +0200
@@ -0,0 +1,96 @@
+diff --git "a/biosig.c" "b/biosig.c"
+index 5872cef..ed7b64a 100644
+--- "a/biosig.c"	
++++ "b/biosig.c"
+@@ -53,7 +53,26 @@
+ #include <locale.h>
+ #include <math.h>      // define macro isnan()
+ #include <stdlib.h>
++#ifdef _WIN32
++// Can't include sys/stat.h or sopen is declared twice.
++#include <sys/types.h>
++struct stat {
++  _dev_t st_dev;
++  _ino_t st_ino;
++  unsigned short st_mode;
++  short st_nlink;
++  short st_uid;
++  short st_gid;
++  _dev_t st_rdev;
++  _off_t st_size;
++  time_t st_atime;
++  time_t st_mtime;
++  time_t st_ctime;
++};
++int __cdecl stat(const char *_Filename,struct stat *_Stat);
++#else
+ #include <sys/stat.h>
++#endif
+ 
+ 
+ #ifdef WITH_CURL
+
+diff --git "a/t210/sopen_heka_read.c" "b/t210/sopen_heka_read.c"
+index d256a15..6025211 100644
+--- "a/t210/sopen_heka_read.c"	
++++ "b/t210/sopen_heka_read.c"
+@@ -24,7 +24,26 @@
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef _WIN32
++// Can't include sys/stat.h or sopen is declared twice.
++#include <sys/types.h>
++struct stat {
++  _dev_t st_dev;
++  _ino_t st_ino;
++  unsigned short st_mode;
++  short st_nlink;
++  short st_uid;
++  short st_gid;
++  _dev_t st_rdev;
++  _off_t st_size;
++  time_t st_atime;
++  time_t st_mtime;
++  time_t st_ctime;
++};
++int __cdecl stat(const char *_Filename,struct stat *_Stat);
++#else
+ #include <sys/stat.h>
++#endif
+ 
+ #include "../biosig.h"
+ 
+
+diff --git "a/test0/sandbox.c" "b/test0/sandbox.c"
+index eed47b7..309c009 100644
+--- "a/test0/sandbox.c"	
++++ "b/test0/sandbox.c"
+@@ -26,7 +26,26 @@
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef _WIN32
++// Can't include sys/stat.h or sopen is declared twice.
++#include <sys/types.h>
++struct stat {
++  _dev_t st_dev;
++  _ino_t st_ino;
++  unsigned short st_mode;
++  short st_nlink;
++  short st_uid;
++  short st_gid;
++  _dev_t st_rdev;
++  _off_t st_size;
++  time_t st_atime;
++  time_t st_mtime;
++  time_t st_ctime;
++};
++int __cdecl stat(const char *_Filename,struct stat *_Stat);
++#else
+ #include <sys/stat.h>
++#endif
+ 
+ #include "../biosig.h"
+ 
+