Skip to content

Commit b29168f

Browse files
Merge pull request #6 from alcomposer/fix-msvc-compile
Fix compile for msvc
2 parents e4ff17d + 6627d55 commit b29168f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pdlua.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,18 @@
3232
#include <sys/types.h> // for open
3333
#include <sys/stat.h> // for open
3434
#ifdef _MSC_VER
35-
#include <io.h>
36-
#include <fcntl.h> // for open
37-
#define read _read
38-
#define close _close
39-
#define ssize_t int
40-
#define snprintf _snprintf
35+
#include <io.h>
36+
#include <fcntl.h> // for open
37+
#ifndef PATH_MAX
38+
#define PATH_MAX 1024 /* same with Mac OS X's syslimits.h */
39+
#endif
40+
#define read _read
41+
#define close _close
42+
#define ssize_t int
43+
#define snprintf _snprintf
4144
#else
42-
#include <sys/fcntl.h> // for open
43-
#include <unistd.h>
45+
#include <sys/fcntl.h> // for open
46+
#include <unistd.h>
4447
#endif
4548
/* we use Lua */
4649
#include <lua.h>
@@ -180,9 +183,6 @@ void initialise_lua_state()
180183
# define PDLUA_DEBUG3 PDLUA_DEBUG
181184
#endif
182185

183-
EXTERN int sys_trytoopenone(const char *dir, const char *name, const char* ext,
184-
char *dirresult, char **nameresult, unsigned int size, int bin);
185-
186186
// In plugdata we're linked statically and thus c_externdir is empty.
187187
// So we pass a data directory to the setup function instead and store it here.
188188
// ag: Renamed to pdlua_datadir since we also need this in vanilla when

0 commit comments

Comments
 (0)