This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 51
51
#include <time.h>
52
52
#include <sys/types.h>
53
53
54
- #if defined(DJGPP ) || defined(__MINGW32__ ) || defined(WIN32 ) || defined(WIN64 )
54
+ #if !defined(__WIN32__ ) && (defined(_WIN32 ) || defined(WIN32 ) || defined(_WIN64 ))
55
+ #define __WIN32__
56
+ #endif
57
+
58
+ #if defined(DJGPP ) || defined(__MINGW32__ ) || defined(__WIN32__ )
55
59
#define fseeko fseek
56
60
#define ftello ftell
57
61
#else
58
62
#define fgetc getc_unlocked
59
63
#endif
64
+
60
65
#ifdef __CYGWIN__
61
66
#include <io.h>
62
67
#endif
63
- #ifdef WIN32
68
+
69
+ #ifdef __WIN32__
64
70
#include <sys/utime.h>
65
71
#include <winsock2.h>
66
72
#pragma comment(lib, "ws2_32.lib")
@@ -109,6 +115,19 @@ typedef unsigned long long UINT64;
109
115
#define ushort unsigned short
110
116
#endif
111
117
118
+ #define strnlen (s ,maxlen ) strnlen_port(s,maxlen)
119
+ static size_t strnlen (const char * s , size_t maxlen )
120
+ {
121
+ size_t i ;
122
+
123
+ for (i = 0 ; (i < maxlen ) && (s [i + 1 ] != '\0' ); i ++ )
124
+ {
125
+ }
126
+
127
+ return i ;
128
+ }
129
+
130
+
112
131
/*
113
132
All global variables are defined here, and all functions that
114
133
access them are prefixed with "CLASS". Note that a thread-safe
You can’t perform that action at this time.
0 commit comments