From 377a7a968b6a906f262a45abea9a563ffc471938 Mon Sep 17 00:00:00 2001 From: Naram Qashat Date: Mon, 24 Oct 2011 16:32:29 -0400 Subject: Fixed bug #1349 (m_sqlite compiles without error under FreeBSD), as well as use C99's stdint.h (or cstdint if available) to get (u)intX_t types instead of our stupid typedefs. pstdint.h included in case there is no cstdint or stdint.h available. --- include/account.h | 2 +- include/bots.h | 2 +- include/channels.h | 8 ++--- include/extern.h | 12 +++---- include/modules.h | 2 +- include/regchannel.h | 20 ++++++------ include/services.h | 2 +- include/sysconf.h.cmake | 84 +++++-------------------------------------------- 8 files changed, 32 insertions(+), 100 deletions(-) (limited to 'include') diff --git a/include/account.h b/include/account.h index 3cfb803f8..395d883dc 100644 --- a/include/account.h +++ b/include/account.h @@ -158,7 +158,7 @@ class CoreExport NickCore : public Extensible, public Flags aliases; /* List of aliases */ diff --git a/include/bots.h b/include/bots.h index c23a354fc..64d185840 100644 --- a/include/bots.h +++ b/include/bots.h @@ -35,7 +35,7 @@ static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "CONF class CoreExport BotInfo : public User, public Flags, public Serializable { public: - uint32 chancount; + uint32_t chancount; time_t created; /* Birth date ;) */ time_t lastmsg; /* Last time we said something */ typedef Anope::insensitive_map command_map; diff --git a/include/channels.h b/include/channels.h index 81096cbe3..a4e27469c 100644 --- a/include/channels.h +++ b/include/channels.h @@ -43,7 +43,7 @@ class CoreExport Channel : public Extensible, public Flags /** A map of channel modes with their parameters set on this channel */ ModeList modes; - + public: /** Default constructor * @param name The channel name @@ -68,9 +68,9 @@ class CoreExport Channel : public Extensible, public Flags time_t server_modetime; /* Time of last server MODE */ time_t chanserv_modetime; /* Time of last check_modes() */ - int16 server_modecount; /* Number of server MODEs this second */ - int16 chanserv_modecount; /* Number of check_mode()'s this sec */ - int16 bouncy_modes; /* Did we fail to set modes here? */ + int16_t server_modecount; /* Number of server MODEs this second */ + int16_t chanserv_modecount; /* Number of check_mode()'s this sec */ + int16_t bouncy_modes; /* Did we fail to set modes here? */ /** Call if we need to unset all modes and clear all user status (internally). * Only useful if we get a SJOIN with a TS older than what we have here diff --git a/include/extern.h b/include/extern.h index 83907224f..9a1583ec6 100644 --- a/include/extern.h +++ b/include/extern.h @@ -171,8 +171,8 @@ E bool nickIsServices(const Anope::string &nick, bool bot); E void add_entropy_userkeys(); E void rand_init(); E unsigned char getrandom8(); -E uint16 getrandom16(); -E uint32 getrandom32(); +E uint16_t getrandom16(); +E uint32_t getrandom32(); E std::list BuildStringList(const Anope::string &, char = ' '); E std::vector BuildStringVector(const Anope::string &, char = ' '); @@ -208,14 +208,14 @@ E void notice_server(const Anope::string &source, const Server *s, const char *f /**** sockets.cpp ****/ -E int32 TotalRead; -E int32 TotalWritten; +E int32_t TotalRead; +E int32_t TotalWritten; E SocketIO normalSocketIO; /**** users.c ****/ -E int32 opcnt; -E uint32 maxusercnt, usercnt; +E int32_t opcnt; +E uint32_t maxusercnt, usercnt; E time_t maxusertime; E User *finduser(const Anope::string &nick); diff --git a/include/modules.h b/include/modules.h index 376224097..695917dbf 100644 --- a/include/modules.h +++ b/include/modules.h @@ -594,7 +594,7 @@ class CoreExport Module : public Extensible * @param priv The privilege changed * @param what The new level */ - virtual void OnLevelChange(User *u, ChannelInfo *ci, const Anope::string &priv, int16 what) { } + virtual void OnLevelChange(User *u, ChannelInfo *ci, const Anope::string &priv, int16_t what) { } /** Called when a channel is dropped * @param chname The channel name diff --git a/include/regchannel.h b/include/regchannel.h index 680be5b44..62d3eeccc 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -152,7 +152,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags access; /* List of authorized users */ std::vector akick; /* List of users to kickban */ std::vector badwords; /* List of badwords */ - std::map levels; + std::map levels; public: typedef std::multimap ModeList; @@ -184,7 +184,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags botflags; - int16 ttb[TTB_SIZE]; /* Times to ban for each kicker */ + int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */ - int16 capsmin, capspercent; /* For CAPS kicker */ - int16 floodlines, floodsecs; /* For FLOOD kicker */ - int16 repeattimes; /* For REPEAT kicker */ + int16_t capsmin, capspercent; /* For CAPS kicker */ + int16_t floodlines, floodsecs; /* For FLOOD kicker */ + int16_t repeattimes; /* For REPEAT kicker */ serialized_data serialize(); static void unserialize(serialized_data &); @@ -377,7 +377,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags, public Serializable struct CoreExport MemoInfo { - int16 memomax; + int16_t memomax; std::vector memos; std::vector ignores; diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake index ff391a7b1..8470f81c4 100644 --- a/include/sysconf.h.cmake +++ b/include/sysconf.h.cmake @@ -4,7 +4,7 @@ #cmakedefine DEBUG_BUILD #cmakedefine DEFUMASK @DEFUMASK@ -#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_CSTDINT 1 #cmakedefine HAVE_STDINT_H 1 #cmakedefine HAVE_STDDEF_H 1 #cmakedefine HAVE_SETGRENT 1 @@ -18,85 +18,17 @@ #cmakedefine GETTEXT_FOUND 1 #cmakedefine RUNGROUP "@RUNGROUP@" -#cmakedefine HAVE_UINT8_T 1 -#cmakedefine HAVE_U_INT8_T 1 -#cmakedefine HAVE_INT16_T 1 -#cmakedefine HAVE_UINT16_T 1 -#cmakedefine HAVE_U_INT16_T 1 -#cmakedefine HAVE_INT32_T 1 -#cmakedefine HAVE_UINT32_T 1 -#cmakedefine HAVE_U_INT32_T 1 - -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STDDEF_H -# include -#endif - -#ifdef HAVE_UINT8_T -typedef uint8_t uint8; -#else -# ifdef HAVE_U_INT8_T -typedef u_int8_t uint8; -# else -# ifdef _WIN32 -typedef unsigned __int8 uint8; -# else -typedef unsigned short uint8; -# endif -# endif -#endif - -#ifdef HAVE_INT16_T -typedef int16_t int16; -#else -# ifdef _WIN32 -typedef signed __int16 int16; -# else -typedef int int16; -# endif -#endif - -#ifdef HAVE_UINT16_T -typedef uint16_t uint16; -#else -# ifdef HAVE_U_INT16_T -typedef u_int16_t uint16; -# else -# ifdef _WIN32 -typedef unsigned __int16 uint16; -# else -typedef unsigned int uint16; -# endif -# endif -#endif - -#ifdef HAVE_INT32_T -typedef int32_t int32; +#ifdef HAVE_CSTDINT +# include #else -# ifdef _WIN32 -typedef signed __int32 int32; +# ifdef HAVE_STDINT_H +# include # else -typedef long int32; +# include "pstdint.h" # endif #endif - -#ifdef HAVE_UINT32_T -typedef uint32_t uint32; -#else -# ifdef HAVE_U_INT32_T -typedef u_int32_t uint32; -# else -# ifdef _WIN32 -typedef unsigned __int32 uint32; -# else -typedef unsigned long uint32; -# endif -# endif +#ifdef HAVE_STDDEF_H +# include #endif #ifdef _WIN32 -- cgit