From b97db66908c73a912c7b14f9502bad2fd6f7971a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Jan 2013 13:58:32 +0000 Subject: [Bug 3598300]: unix: tcl.h does not include sys/stat.h. (with an exception for OSX, for now) --- ChangeLog | 5 +++++ generic/tclPort.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3cbdd1a..9328946 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-18 Jan Nijtmans + + * generic/tclPort.h: [Bug 3598300]: unix: tcl.h does not include + sys/stat.h + 2013-01-16 Jan Nijtmans * Makefile.in: Enable win32 build with -DTCL_NO_DEPRECATED, just diff --git a/generic/tclPort.h b/generic/tclPort.h index 7021b8d..198ee76 100644 --- a/generic/tclPort.h +++ b/generic/tclPort.h @@ -19,9 +19,11 @@ #endif #if defined(_WIN32) # include "tclWinPort.h" +#elif !defined(MAC_OSX_TCL) +# include "tclUnixPort.h" #endif #include "tcl.h" -#if !defined(_WIN32) +#if defined(MAC_OSX_TCL) # include "tclUnixPort.h" #endif -- cgit v0.12 From f50af0e8c33d29a694f03efedfc7bf1ae18b3e16 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Jan 2013 14:30:25 +0000 Subject: ... and fix cygwin build --- unix/tclUnixFile.c | 6 ++++-- unix/tclUnixPort.h | 34 +++++++++++++++------------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 40434a0..5abac9d 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -1183,8 +1183,9 @@ TclpUtime( return utime(Tcl_FSGetNativePath(pathPtr), tval); } #ifdef __CYGWIN__ -int TclOSstat(const char *name, Tcl_StatBuf *statBuf) { +int TclOSstat(const char *name, void *cygstat) { struct stat buf; + Tcl_StatBuf *statBuf = cygstat; int result = stat(name, &buf); statBuf->st_mode = buf.st_mode; statBuf->st_ino = buf.st_ino; @@ -1199,8 +1200,9 @@ int TclOSstat(const char *name, Tcl_StatBuf *statBuf) { statBuf->st_ctime = buf.st_ctime; return result; } -int TclOSlstat(const char *name, Tcl_StatBuf *statBuf) { +int TclOSlstat(const char *name, void *cygstat) { struct stat buf; + Tcl_StatBuf *statBuf = cygstat; int result = lstat(name, &buf); statBuf->st_mode = buf.st_mode; statBuf->st_ino = buf.st_ino; diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 4668707..99c564b 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -22,10 +22,6 @@ #ifndef _TCLUNIXPORT #define _TCLUNIXPORT - -#ifndef MODULE_SCOPE -#define MODULE_SCOPE extern -#endif /* *--------------------------------------------------------------------------- @@ -89,21 +85,21 @@ typedef off_t Tcl_SeekOffset; # define HINSTANCE void * # define SOCKET unsigned int # define WSAEWOULDBLOCK 10035 - DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *); - DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int); - DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int, + __declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *); + __declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const char *, int); + __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const char *, int, const char *, int, const char *, const char *); - DLLIMPORT extern int cygwin_conv_path(int, const void *, void *, int); - DLLIMPORT extern int cygwin_conv_path_list(int, const void *, void *, int); + __declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int); + __declspec(dllimport) extern int cygwin_conv_path_list(int, const void *, void *, int); # define USE_PUTENV 1 # define USE_PUTENV_FOR_UNSET 1 /* On Cygwin, the environment is imported from the Cygwin DLL. */ # define environ __cygwin_environ # define timezone _timezone - DLLIMPORT extern char **__cygwin_environ; - MODULE_SCOPE int TclOSstat(const char *name, Tcl_StatBuf *statBuf); - MODULE_SCOPE int TclOSlstat(const char *name, Tcl_StatBuf *statBuf); + extern char **__cygwin_environ; + extern int TclOSstat(const char *name, void *statBuf); + extern int TclOSlstat(const char *name, void *statBuf); #elif defined(HAVE_STRUCT_STAT64) # define TclOSstat stat64 # define TclOSlstat lstat64 @@ -147,7 +143,7 @@ typedef off_t Tcl_SeekOffset; # include "../compat/unistd.h" #endif -MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode); +extern int TclUnixSetBlockingMode(int fd, int mode); #include @@ -658,11 +654,11 @@ extern int pthread_getattr_np (pthread_t, pthread_attr_t *); #include -MODULE_SCOPE struct passwd* TclpGetPwNam(const char *name); -MODULE_SCOPE struct group* TclpGetGrNam(const char *name); -MODULE_SCOPE struct passwd* TclpGetPwUid(uid_t uid); -MODULE_SCOPE struct group* TclpGetGrGid(gid_t gid); -MODULE_SCOPE struct hostent* TclpGetHostByName(const char *name); -MODULE_SCOPE struct hostent* TclpGetHostByAddr(const char *addr, int length, int type); +extern struct passwd* TclpGetPwNam(const char *name); +extern struct group* TclpGetGrNam(const char *name); +extern struct passwd* TclpGetPwUid(uid_t uid); +extern struct group* TclpGetGrGid(gid_t gid); +extern struct hostent* TclpGetHostByName(const char *name); +extern struct hostent* TclpGetHostByAddr(const char *addr, int length, int type); #endif /* _TCLUNIXPORT */ -- cgit v0.12