Author: cazfi
Date: Mon May  2 16:20:47 2016
New Revision: 32541

URL: http://svn.gna.org/viewcvs/freeciv?rev=32541&view=rev
Log:
Add DIR_SEPARATOR and PATH_SEPARATOR definitions to shared.h just once, 
replacing separate definitions
in all places that need them.

See patch #7158

Modified:
    trunk/client/options.c
    trunk/server/gamehand.c
    trunk/utility/shared.c
    trunk/utility/shared.h

Modified: trunk/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=32541&r1=32540&r2=32541&view=diff
==============================================================================
--- trunk/client/options.c      (original)
+++ trunk/client/options.c      Mon May  2 16:20:47 2016
@@ -5056,18 +5056,6 @@
   }
 }
 
-#ifndef DIR_SEPARATOR
-#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
-  /* Win32, OS/2, DOS */
-# define DIR_SEPARATOR "\\"
-# define DIR_SEPARATOR_CHAR '\\'
-#else
-  /* Unix */
-# define DIR_SEPARATOR "/"
-# define DIR_SEPARATOR_CHAR '/'
-#endif
-#endif
-
 /* Old rc file name. */
 #define OLD_OPTION_FILE_NAME ".civclientrc"
 /* New rc file name. */

Modified: trunk/server/gamehand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/gamehand.c?rev=32541&r1=32540&r2=32541&view=diff
==============================================================================
--- trunk/server/gamehand.c     (original)
+++ trunk/server/gamehand.c     Mon May  2 16:20:47 2016
@@ -52,18 +52,6 @@
 #include "gamehand.h"
 
 #define CHALLENGE_ROOT "challenge"
-
-#ifndef DIR_SEPARATOR
-#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
-  /* Win32, OS/2, DOS */
-# define DIR_SEPARATOR "\\"
-# define DIR_SEPARATOR_CHAR '\\'
-#else
-  /* Unix */
-# define DIR_SEPARATOR "/"
-# define DIR_SEPARATOR_CHAR '/'
-#endif
-#endif
 
 #define SPECLIST_TAG startpos
 #define SPECLIST_TYPE struct startpos

Modified: trunk/utility/shared.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.c?rev=32541&r1=32540&r2=32541&view=diff
==============================================================================
--- trunk/utility/shared.c      (original)
+++ trunk/utility/shared.c      Mon May  2 16:20:47 2016
@@ -68,30 +68,6 @@
 #include "support.h"
 
 #include "shared.h"
-
-#ifndef PATH_SEPARATOR
-#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
-  /* Win32, OS/2, DOS */
-# define PATH_SEPARATOR ";"
-#else
-  /* Unix */
-# define PATH_SEPARATOR ":"
-#endif
-#endif
-
-#ifndef DIR_SEPARATOR
-#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
-  /* Win32, OS/2, DOS */
-# define DIR_SEPARATOR "\\"
-# define DIR_SEPARATOR_CHAR '\\'
-#else
-  /* Unix */
-# define DIR_SEPARATOR "/"
-# define DIR_SEPARATOR_CHAR '/'
-#endif
-#endif
-
-#define PARENT_DIR_OPERATOR ".."
 
 /* If no default data path is defined use the default default one */
 #ifndef DEFAULT_DATA_PATH

Modified: trunk/utility/shared.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.h?rev=32541&r1=32540&r2=32541&view=diff
==============================================================================
--- trunk/utility/shared.h      (original)
+++ trunk/utility/shared.h      Mon May  2 16:20:47 2016
@@ -104,6 +104,30 @@
       (array)[_ini_index] = (value);                                       \
     }                                                                      \
   }
+
+#ifndef PATH_SEPARATOR
+#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
+  /* Win32, OS/2, DOS */
+# define PATH_SEPARATOR ";"
+#else
+  /* Unix */
+# define PATH_SEPARATOR ":"
+#endif
+#endif /* PATH_SEPARATOR */
+
+#ifndef DIR_SEPARATOR
+#if defined(WIN32_NATIVE) || defined(_WIN32) || defined(__WIN32__) || 
defined(__EMX__) || defined(__DJGPP__)
+  /* Win32, OS/2, DOS */
+# define DIR_SEPARATOR "\\"
+# define DIR_SEPARATOR_CHAR '\\'
+#else
+  /* Unix */
+# define DIR_SEPARATOR "/"
+# define DIR_SEPARATOR_CHAR '/'
+#endif
+#endif /* DIR_SEPARATOR */
+
+#define PARENT_DIR_OPERATOR ".."
 
 char *create_centered_string(const char *s);
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to