1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 07:45:43 +02:00

Cleanup in modulemanager.cpp, make it so CMake only includes the -fno-leading-underscore flag on a GNU compiler, changed the hash compare functions to use struct to appease clang, and made it so hashcomp.h uses tr1/unordered_map with g++ 4.x or up.

This commit is contained in:
Naram Qashat
2010-07-30 19:24:41 -04:00
parent a68e215bad
commit 7a7b8933bb
3 changed files with 49 additions and 67 deletions
+5 -4
View File
@@ -231,11 +231,12 @@ if(MSVC)
else(MSVC)
# Set the compile flags to have all warnings on (including shadowed variables)
set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
# If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols
# If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler)
if(UNIX)
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic -fno-leading-underscore")
# Set the module-specific compile flags to the same setting as the compile flags
set(MODULE_CXXFLAGS "${CXXFLAGS}")
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# If we aren't on a *nix system, we are using MinGW
else(UNIX)
# Also, if we are building under MinGW, add another define for MinGW
+6 -6
View File
@@ -34,7 +34,7 @@ namespace Anope
}
#ifndef _WIN32
# ifndef USE_HASHMAP
# if defined(__GNUC__) && __GNUC__ >= 4
/* GCC4.3+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. */
# include <tr1/unordered_map>
# define unordered_map_namespace std::tr1
@@ -262,7 +262,7 @@ namespace std
/** An overload for std::equal_to<ci::string> that uses Anope::string, passed for the fourth temmplate
* argument for unordered_map
*/
template<> class CoreExport equal_to<ci::string>
template<> struct CoreExport equal_to<ci::string>
{
public:
/** Compare two Anope::strings as ci::strings
@@ -276,7 +276,7 @@ namespace std
/** An overload for std::equal_to<irc::string> that uses Anope::string, passed for the fourth template
* argument for unorderd_map
*/
template<> class CoreExport equal_to<irc::string>
template<> struct CoreExport equal_to<irc::string>
{
public:
/** Compare two Anope::strings as irc::strings
@@ -290,9 +290,9 @@ namespace std
/** An overload for std::less<ci::string> that uses Anope::string, passed for the third template argument
* to std::map and std::multimap
*/
template<> class CoreExport less<ci::string>
template<> struct CoreExport less<ci::string>
{
public:
public:
/** Compare two Anope::strings as ci::strings and find which one is less
* @param s1 The first string
* @param s2 The second string
@@ -304,7 +304,7 @@ namespace std
/** An overload for std;:less<irc::string> that uses Anope::string, passed for the third tempalte argument
* to std::map and std::multimap
*/
template<> class CoreExport less<irc::string>
template<> struct CoreExport less<irc::string>
{
public:
/** Compare two Anope::strings as irc::strings and find which one is less
+38 -57
View File
File diff suppressed because it is too large Load Diff