]> jfr.im git - irc/gameservirc.git/commitdiff
Fixed the strtok function duplication on some systems via the autoconf script.
authorkainazzzo <redacted>
Mon, 27 Oct 2003 07:18:54 +0000 (07:18 +0000)
committerkainazzzo <redacted>
Mon, 27 Oct 2003 07:18:54 +0000 (07:18 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@29 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/config.h.in
gameserv/configure
gameserv/configure.in
gameserv/extern.h
gameserv/gameserv.cpp

index 390bf371ce47792857773cdde0bd5b2222776d32..df91fef76e31bc7052d1fde843149d4b909fbff8 100644 (file)
@@ -18,6 +18,9 @@
 /* Define if you have the strspn function.  */
 #undef HAVE_STRSPN
 
+/* Define if you have the strtok function.  */
+#undef HAVE_STRTOK
+
 /* Define if you have the strtol function.  */
 #undef HAVE_STRTOL
 
index e37379cfcec95dabf8ab754c8602c429d2ef0041..eb9a56cbed0b810fc1c6c990f496618a7bda9d5d 100755 (executable)
@@ -1050,7 +1050,7 @@ EOF
 fi
 
 
-for ac_func in socket strcspn strspn strtol
+for ac_func in socket strcspn strspn strtol strtok
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:1057: checking for $ac_func" >&5
index f541a643d5bdc98808f4f0c3f6a16d99ce23601d..44233d5b7a0e09404fe58e37945e77f22240bbf8 100644 (file)
@@ -20,6 +20,6 @@ AC_C_CONST
 AC_TYPE_SIZE_T
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS(socket strcspn strspn strtol)
+AC_CHECK_FUNCS(socket strcspn strspn strtol strtok)
 
 AC_OUTPUT(Makefile)
index 5694201c9c04db7a34d8e8464558706728e3cba4..d239c22cde136fb5e9b3a90a602b930c6726a552 100644 (file)
@@ -59,7 +59,11 @@ E bool is_fighting(char *u);
 E bool isnt_fighting(char *u);
 E bool player_fight(char *u);
 E bool master_fight(char *u);
+
+#ifndef HAVE_STRTOK
 E char *strtok(char *str, const char *delim);
+#endif
+
 E char *spaces(int len, char *seperator);
 E void display_monster(char *u);
 E void display_players(char *u);
index 889e1404c3e75e53b669bec918b2c901d5c459d1..54d39bac6f520815d4ab495b728c4539e5a12f2f 100644 (file)
@@ -26,8 +26,10 @@ int save_gs_dbase();
 int load_gs_dbase();
 
 // String functions
-#undef strtok
+#ifndef HAVE_STRTOK
 char *strtok(char *str, const char *delim);
+#endif
+
 int stricmp(const char *s1, const char *s2);
 int strnicmp(const char *s1, const char *s2, size_t len);
 // String Functions
@@ -351,6 +353,7 @@ int strnicmp(const char *s1, const char *s2, size_t len)
     return 1;
 }
 
+#ifndef HAVE_STRTOK
 char *strtok(char *str, const char *delim)
 {
     static char *current = NULL;
@@ -369,6 +372,7 @@ char *strtok(char *str, const char *delim)
         *current++ = 0;
     return ret;
 }
+#endif
 
 void do_list(char *u)
 {