Author: cazfi Date: Mon May 2 16:20:59 2016 New Revision: 32542 URL: http://svn.gna.org/viewcvs/freeciv?rev=32542&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: branches/S2_6/client/options.c branches/S2_6/server/gamehand.c branches/S2_6/utility/shared.c branches/S2_6/utility/shared.h Modified: branches/S2_6/client/options.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=32542&r1=32541&r2=32542&view=diff ============================================================================== --- branches/S2_6/client/options.c (original) +++ branches/S2_6/client/options.c Mon May 2 16:20:59 2016 @@ -4808,18 +4808,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: branches/S2_6/server/gamehand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/gamehand.c?rev=32542&r1=32541&r2=32542&view=diff ============================================================================== --- branches/S2_6/server/gamehand.c (original) +++ branches/S2_6/server/gamehand.c Mon May 2 16:20:59 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: branches/S2_6/utility/shared.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/shared.c?rev=32542&r1=32541&r2=32542&view=diff ============================================================================== --- branches/S2_6/utility/shared.c (original) +++ branches/S2_6/utility/shared.c Mon May 2 16:20:59 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: branches/S2_6/utility/shared.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/shared.h?rev=32542&r1=32541&r2=32542&view=diff ============================================================================== --- branches/S2_6/utility/shared.h (original) +++ branches/S2_6/utility/shared.h Mon May 2 16:20:59 2016 @@ -105,6 +105,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