aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libdvdnav/msvc.diff
blob: 314871a53269a86f6770942c3b48b52589288e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/msvc/config.h b/msvc/config.h
index 25f68fb..c3f00f1 100644
--- a/msvc/config.h
+++ b/msvc/config.h
@@ -28,7 +28,8 @@
 #define inline __inline
 /* #undef size_t */
 
-#define ssize_t __int64
+#include <windows.h>
+typedef SSIZE_T ssize_t;
 
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
@@ -43,14 +44,6 @@
 #define S_ISCHR(m) 0
 
 /* Fallback types (very x86-centric, sorry) */
-typedef unsigned char       uint8_t;
-typedef signed char         int8_t;
-typedef unsigned short      uint16_t;
-typedef signed short        int16_t;
-typedef unsigned int        uint32_t;
-typedef signed int          int32_t;
-typedef unsigned __int64    uint64_t;
-typedef signed __int64      int64_t;
-typedef unsigned int        uintptr_t;
+#include <stdint.h>
 
 #endif /* LIBDVNAV_CONFIG_H */
diff --git a/msvc/include/sys/time.h b/msvc/include/sys/time.h
index 843e252..8014739 100644
--- a/msvc/include/sys/time.h
+++ b/msvc/include/sys/time.h
@@ -26,3 +26,4 @@
  */
 
 #include <time.h>
+#include <winsock2.h>
diff --git a/src/dvdnav_internal.h b/src/dvdnav_internal.h
index 495f032..a0aaeaf 100644
--- a/src/dvdnav_internal.h
+++ b/src/dvdnav_internal.h
@@ -39,6 +39,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
 #ifndef HAVE_GETTIMEOFDAY
 /* replacement gettimeofday implementation */
 #include <sys/timeb.h>
+#include <winsock2.h>
 static inline int _private_gettimeofday( struct timeval *tv, void *tz )
 {
   struct timeb t;
@@ -232,7 +233,7 @@ int64_t dvdnav_convert_time(dvd_time_t *time);
 #define printerrf(format, args...) \
     do { if (this) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); } while (0)
 #else
-#ifdef _MSC_VER
+#if 0
 #define printerrf(str) \
     do { if (this) snprintf(this->err_str, MAX_ERR_LEN, str); } while (0)
 #else
diff --git a/src/read_cache.c b/src/read_cache.c
index 1b2862d..abc786a 100644
--- a/src/read_cache.c
+++ b/src/read_cache.c
@@ -87,7 +87,7 @@ struct read_cache_s {
 # if READ_CACHE_TRACE
 #  define dprintf(fmt, ...) fprintf(MSG_OUT, "libdvdnav: %s: "fmt,  __func__ , __VA_ARGS__)
 # else
-#ifdef _MSC_VER
+#if 0
 #  define dprintf(fmt, str) /* Nowt */
 #else
 #  define dprintf(fmt, ...) /* Nowt */