Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit d2e7e7d

Browse files
committed
Loadlib fix for recent Cygwin releases
1 parent a77a47e commit d2e7e7d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/loadlib_rel.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ static void setprogdir (lua_State *L);
5050
** Modified by the LuaDist project for UNIX platforms
5151
** ==========================================================================
5252
*/
53-
#if defined(_WIN32) || defined(__CYGWIN__)
53+
#if defined(_WIN32)
5454
#include <windows.h>
5555
#define _PATH_MAX MAX_PATH
5656
#else
5757
#define _PATH_MAX PATH_MAX
5858
#endif
5959

60+
#if defined(__CYGWIN__)
61+
#include <sys/cygwin.h>
62+
#endif
63+
6064
#if defined(__linux__) || defined(__sun)
6165
#include <unistd.h> /* readlink */
6266
#endif
@@ -79,7 +83,7 @@ static void setprogdir(lua_State *L) {
7983
#if defined(__CYGWIN__)
8084
char win_buff[_PATH_MAX + 1];
8185
GetModuleFileNameA(NULL, win_buff, nsize);
82-
cygwin_conv_to_posix_path(win_buff, progdir);
86+
cygwin_conv_path (CCP_WIN_A_TO_POSIX, win_buff, progdir, nsize);
8387
n = strlen(progdir);
8488
#elif defined(_WIN32)
8589
n = GetModuleFileNameA(NULL, progdir, nsize);

0 commit comments

Comments
 (0)