summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstwo <stwo>2012-08-13 22:27:14 (GMT)
committerstwo <stwo>2012-08-13 22:27:14 (GMT)
commit15741b0a0f7182f52283a7c3cac4513b14af1359 (patch)
treefe40135dea91c354c9301deccb6c49a5b6387976
parentc31f309b59260de32048173493f3463dbdaa51f7 (diff)
downloadtcl-15741b0a0f7182f52283a7c3cac4513b14af1359.zip
tcl-15741b0a0f7182f52283a7c3cac4513b14af1359.tar.gz
tcl-15741b0a0f7182f52283a7c3cac4513b14af1359.tar.bz2
[Bug 3555454] Rearrange a bit to quash 'declared but never defined' compiler warnings.
-rw-r--r--ChangeLog5
-rw-r--r--unix/tclUnixCompat.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d6499d7..5374478 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-13 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * unix/tclUnixCompat.c: [Bug 3555454] Rearrange a bit
+ to quash 'declared but never defined' compiler warnings.
+
2012-08-08 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclfileName.c: [Bug #1536227]: Cygwin network pathname
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 8b067af..06c19b9 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -99,12 +99,20 @@ static Tcl_Mutex compatLock;
#undef NEED_COPYPWD
#undef NEED_COPYSTRING
+#if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4)
+#define NEED_COPYGRP 1
+static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
+#endif
+
+#if !defined(HAVE_GETPWNAM_R_5) && !defined(HAVE_GETPWNAM_R_4)
+#define NEED_COPYPWD 1
+static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
+#endif
+
static int CopyArray(char **src, int elsize, char *buf,
int buflen);
-static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
static int CopyHostent(struct hostent *tgtPtr, char *buf,
int buflen);
-static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
static int CopyString(const char *src, char *buf, int buflen);
#endif
@@ -214,7 +222,6 @@ TclpGetPwNam(
return getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf));
#else
-#define NEED_COPYPWD 1
struct passwd *pwPtr;
Tcl_MutexLock(&compatLock);
@@ -295,7 +302,6 @@ TclpGetPwUid(
return getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf));
#else
-#define NEED_COPYPWD 1
struct passwd *pwPtr;
Tcl_MutexLock(&compatLock);
@@ -399,7 +405,6 @@ TclpGetGrNam(
return getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf));
#else
-#define NEED_COPYGRP 1
struct group *grPtr;
Tcl_MutexLock(&compatLock);
@@ -480,7 +485,6 @@ TclpGetGrGid(
return getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf));
#else
-#define NEED_COPYGRP 1
struct group *grPtr;
Tcl_MutexLock(&compatLock);