summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 23:59:26 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 23:59:26 +0000
commit59aae2ed7a29f22b90bec24962e83d7a420dc4d1 (patch)
treef284f1b22feed2b6b95e44c008ff4c4fad35232e /src
parent316de00df4e63468923c5678dcf7c12fc8e59523 (diff)
downloadhercules-59aae2ed7a29f22b90bec24962e83d7a420dc4d1.tar.gz
hercules-59aae2ed7a29f22b90bec24962e83d7a420dc4d1.tar.bz2
hercules-59aae2ed7a29f22b90bec24962e83d7a420dc4d1.tar.xz
hercules-59aae2ed7a29f22b90bec24962e83d7a420dc4d1.zip
- Fixed ladmin's linux compilation and moved some platform specific defines to cbasetypes.h
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9435 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/Makefile6
-rw-r--r--src/common/cbasetypes.h44
-rw-r--r--src/common/mmo.h26
-rw-r--r--src/common/utils.c6
4 files changed, 52 insertions, 30 deletions
diff --git a/src/common/Makefile b/src/common/Makefile
index 2c929b52b..e601baae4 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -29,9 +29,10 @@ ifeq ($(findstring /,$(HAVESVN)), /)
svnversion.h:
@printf "#define SVNVERSION " > svnversion.h
@svnversion . >> svnversion.h
+ @printf "\n" >> svnversion.h
else
svnversion.h:
- @printf "" > svnversion.h
+ @printf "\n" > svnversion.h
endif
obj/minicore.o: core.c core.h
@@ -54,3 +55,6 @@ obj/plugins.o: plugins.c plugins.h plugin.h
obj/showmsg.o: showmsg.c showmsg.h
obj/strlib.o: strlib.c strlib.h utils.h
obj/mapindex.o: mapindex.c mapindex.h
+obj/utils.o: utils.c utils.h malloc.h showmsg.h mmo.h
+mmo.h: cbasetypes.h
+ @touch mmo.h
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 0f443192d..ff00aaa49 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -243,6 +243,9 @@ typedef int bool;
#endif // not cplusplus
//////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// macro tools
+
#ifdef swap // just to be sure
#undef swap
#endif
@@ -271,4 +274,45 @@ typedef int bool;
#define NBBY 8
#endif
+//////////////////////////////////////////////////////////////////////////
+// path separator
+
+#if defined(WIN32)
+#define PATHSEP '\\'
+#elif defined(__APPLE__)
+#define PATHSEP ':'
+#else
+#define PATHSEP '/'
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+// EOL separator
+
+#if defined(WIN32) || defined(CYGWIN)
+#define RETCODE "\r\n" // CR/LF : Windows systems
+#elif defined(__APPLE__)
+#define RETCODE "\r" // CR : Macintosh systems
+#else
+#define RETCODE "\n" // LF : Unix systems
+#endif
+
+#define RET RETCODE
+
+//////////////////////////////////////////////////////////////////////////
+// Assert
+
+#if ! defined(Assert)
+#if defined(RELEASE)
+#define Assert(EX)
+#else
+// extern "C" {
+#include <assert.h>
+// }
+#if !defined(DEFCPP) && defined(WIN32) && !defined(MINGW)
+#include <crtdbg.h>
+#endif
+#define Assert(EX) assert(EX)
+#endif
+#endif /* ! defined(Assert) */
+
#endif /* _CBASETYPES_H_ */
diff --git a/src/common/mmo.h b/src/common/mmo.h
index f65da260b..d0606dd4e 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -5,33 +5,9 @@
#define _MMO_H_
#include <time.h>
+#include "cbasetypes.h"
#include "utils.h" // _WIN32
-#if ! defined(Assert)
-#if defined(RELEASE)
-#define Assert(EX)
-#else
-// extern "C" {
-#include <assert.h>
-// }
-#ifndef DEFCPP
-#if defined(_WIN32) && !defined(MINGW)
-#include <crtdbg.h>
-#endif
-#endif
-#define Assert(EX) assert(EX)
-#endif
-#endif /* ! defined(Assert) */
-
-#ifdef CYGWIN
-// txtやlogなどの書き出すファイルの改行コード
-#define RETCODE "\r\n" // (CR/LF:Windows系)
-#else
-#define RETCODE "\n" // (LF:Unix系)
-#endif
-
-#define RET RETCODE
-
#define FIFOSIZE_SERVERLINK 256*1024
// set to 0 to not check IP of player between each server.
diff --git a/src/common/utils.c b/src/common/utils.c
index c7b3b517a..6d4abb26d 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -8,12 +8,10 @@
#ifdef WIN32
#include <windows.h>
- #define PATHSEP '\\'
#else
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
- #define PATHSEP '/'
#endif
#include "utils.h"
@@ -285,8 +283,8 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
}
}while (FindNextFile(hFind, &FindFileData) != 0);
FindClose(hFind);
- }
- return;
+ }
+ return;
}
#else