From 9f47d257ba5bb985bc6753b0f20b90da18664cd1 Mon Sep 17 00:00:00 2001 From: ultramage Date: Mon, 16 Apr 2007 20:44:44 +0000 Subject: * Finally fixed mingw problems, managed to build both TXT and SQL * Fixed the uint32 platform problem (Microsoft failed so I removed it :) * Removed the cbasetypes.h dependency from the mapcache generator * Removed some random compilation warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10270 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/cbasetypes.h | 21 +-------------------- src/common/db.c | 6 +++--- src/common/nullpo.h | 5 +++-- src/common/showmsg.c | 4 ++-- src/common/strlib.h | 2 +- 5 files changed, 10 insertions(+), 28 deletions(-) (limited to 'src/common') diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 67c5a45db..c066c1ebd 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -53,7 +53,7 @@ #endif // disable attributed stuff on non-GNU -#ifndef __GNUC__ +#if !defined(__GNUC__) && !defined(MINGW) # define __attribute__(x) #endif @@ -74,26 +74,10 @@ // Integers with guaranteed _exact_ size. ////////////////////////////////////////////////////////////////////////// -////////////////////////////// -#ifdef WIN32 -////////////////////////////// #define SIZEOF_LONG 4 #define SIZEOF_INT 4 #define HAVE_INT_8_16_32 -typedef __int8 int8; -typedef __int16 int16; -typedef __int32 int32; -typedef signed __int8 sint8; -typedef signed __int16 sint16; -typedef signed __int32 sint32; - -typedef unsigned __int8 uint8; -typedef unsigned __int16 uint16; -typedef unsigned __int32 uint32; -////////////////////////////// -#else // GNU -////////////////////////////// typedef char int8; typedef short int16; typedef int int32; @@ -105,9 +89,6 @@ typedef signed int sint32; typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; -////////////////////////////// -#endif -////////////////////////////// #undef UINT8_MIN #undef UINT16_MIN diff --git a/src/common/db.c b/src/common/db.c index 98d7ae032..7d1eb3903 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -600,7 +600,7 @@ static int db_is_key_null(DBType type, DBKey key) */ static DBKey db_dup_key(DB_impl db, DBKey key) { - unsigned char *str; + char *str; #ifdef DB_ENABLE_STATS COUNT(db_dup_key); @@ -609,12 +609,12 @@ static DBKey db_dup_key(DB_impl db, DBKey key) case DB_STRING: case DB_ISTRING: if (db->maxlen) { - CREATE(str, unsigned char, db->maxlen +1); + CREATE(str, char, db->maxlen +1); memcpy(str, key.str, db->maxlen); str[db->maxlen] = '\0'; key.str = str; } else { - key.str = (unsigned char *)aStrdup((const char *)key.str); + key.str = (char *)aStrdup(key.str); } return key; diff --git a/src/common/nullpo.h b/src/common/nullpo.h index 71525dd00..0238d2b6d 100644 --- a/src/common/nullpo.h +++ b/src/common/nullpo.h @@ -19,8 +19,9 @@ #endif #endif -#ifdef _WIN32 -#define __attribute__(x) /* nothing */ + +#if !defined(__GNUC__) && !defined(MINGW) +# define __attribute__(x) /* nothing */ #endif diff --git a/src/common/showmsg.c b/src/common/showmsg.c index c61530204..f56c66525 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -349,7 +349,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) // \033[2J - Clears the screen and moves the cursor to the home position (line 1, column 1). uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F); int cnt; - uint32 tmp; + DWORD tmp; COORD origin = {0,0}; if(num==1) { // chars from start up to and including cursor @@ -377,7 +377,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F); COORD origin = {0,info.dwCursorPosition.Y}; SHORT cnt; - uint32 tmp; + DWORD tmp; if(num==1) { cnt = info.dwCursorPosition.X + 1; diff --git a/src/common/strlib.h b/src/common/strlib.h index db54d2969..5abd07e90 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -8,7 +8,7 @@ char* jstrescape (char* pt); char* jstrescapecpy (char* pt, const char* spt); int jmemescapecpy (char* pt, const char* spt, int size); -int remove_control_chars(char *); +int remove_control_chars(char* str); char* trim(char* str); char* normalize_name(char* str,const char* delims); const char *stristr(const char *haystack, const char *needle); -- cgit v1.2.3-60-g2f50