1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 11:25:42 +02:00

Remove some CoreExports and add them in other places, fixed a few minor warnings under Windows build, made Windows build create a static library out of win32_memory.cpp and use that with everything instead of relying on it being compiled into everything (saves compiling time).

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2656 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2009-11-18 01:05:12 +00:00
parent e10fe1cd76
commit da8a1c7b60
13 changed files with 65 additions and 60 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ enum NickCoreFlag
/** XXX: this really needs to die with fire and be merged with metadata into NickCore or something.
*/
class NickRequest
class CoreExport NickRequest
{
public:
NickRequest(const std::string &nickname);
+7 -7
View File
@@ -113,7 +113,7 @@ namespace irc
* @return similar to strcmp, zero for equal, less than zero for str1
* being less and greater than zero for str1 being greater than str2.
*/
static CoreExport int compare(const char *str1, const char *str2, size_t n);
static int compare(const char *str1, const char *str2, size_t n);
/** Find a char within a string up to position n.
* @param s1 String to find in
@@ -121,7 +121,7 @@ namespace irc
* @param c Character to search for
* @return Pointer to the first occurance of c in s1
*/
static CoreExport const char *find(const char *s1, int n, char c);
static const char *find(const char *s1, int n, char c);
};
/** This typedef declares irc::string based upon irc_char_traits.
@@ -137,7 +137,7 @@ namespace ci
* This class is used to implement ci::string, a case-insensitive, ASCII-
* comparing string class.
*/
struct ci_char_traits : std::char_traits<char>
struct CoreExport ci_char_traits : std::char_traits<char>
{
/** Check if two chars match.
* @param c1st First character
@@ -167,7 +167,7 @@ namespace ci
* @return similar to strcmp, zero for equal, less than zero for str1
* being less and greater than zero for str1 being greater than str2.
*/
static CoreExport int compare(const char *str1, const char *str2, size_t n);
static int compare(const char *str1, const char *str2, size_t n);
/** Find a char within a string up to position n.
* @param s1 String to find in
@@ -175,7 +175,7 @@ namespace ci
* @param c Character to search for
* @return Pointer to the first occurance of c in s1
*/
static CoreExport const char *find(const char *s1, int n, char c);
static const char *find(const char *s1, int n, char c);
};
/** This typedef declares ci::string based upon ci_char_traits.
@@ -449,7 +449,7 @@ class CoreExport sepstream
/** A derived form of sepstream, which seperates on commas
*/
class CoreExport commasepstream : public sepstream
class commasepstream : public sepstream
{
public:
/** Initialize with comma seperator
@@ -461,7 +461,7 @@ class CoreExport commasepstream : public sepstream
/** A derived form of sepstream, which seperates on spaces
*/
class CoreExport spacesepstream : public sepstream
class spacesepstream : public sepstream
{
public:
/** Initialize with space seperator
+1 -1
View File
@@ -276,7 +276,7 @@ class CoreExport Command : public Flags<CommandFlag>
Command *next;
};
class CoreExport Version
class Version
{
private:
unsigned Major;
+22 -22
View File
File diff suppressed because it is too large Load Diff
+12 -5
View File
@@ -2,10 +2,8 @@
file(GLOB SRC_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP})
# If not using Visual Studio, don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators
if(NOT MSVC)
remove_item_from_list(SRC_SRCS win32_memory.cpp)
endif(NOT MSVC)
# Don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators
remove_item_from_list(SRC_SRCS win32_memory.cpp)
# If not using Windows, don't include windows.cpp, as it's Windows-specific
if(NOT WIN32)
remove_item_from_list(SRC_SRCS windows.cpp)
@@ -54,12 +52,21 @@ if(WIN32)
endif(MINGW)
endif(WIN32)
# If compiling with Visual Studio, create a static library out of win32_memory.cpp to be included with everything else, needed to override it's override of new/delete operators
if(MSVC)
set_source_files_properties(win32_memory.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
add_library(win32_memory STATIC win32_memory.cpp)
set(WIN32_MEMORY win32_memory)
else(MSVC)
set(WIN32_MEMORY)
endif(MSVC)
# Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module
add_executable(${PROGRAM_NAME} ${SRC_SRCS})
set_target_properties(${PROGRAM_NAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" ENABLE_EXPORTS ON)
# On Windows, also link Anope to the wsock32 library, as well as set the version
if(WIN32)
target_link_libraries(${PROGRAM_NAME} wsock32)
target_link_libraries(${PROGRAM_NAME} wsock32 ${WIN32_MEMORY})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Building the Anope executable requires the language files to be compiled first as well as the version.h header to be generated
-1
View File
@@ -35,7 +35,6 @@ Command *lookup_cmd(Command * list, char *cmd)
return c;
}
}
return NULL;
}
/*************************************************************************/
+5 -4
View File
@@ -27,10 +27,11 @@ foreach(SRC ${CORE_SRCS})
if(TEMP_INCLUDES)
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
endif(TEMP_INCLUDES)
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
# For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
if(MSVC)
append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
set(WIN32_MEMORY win32_memory)
else(MSVC)
set(WIN32_MEMORY)
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
@@ -38,7 +39,7 @@ foreach(SRC ${CORE_SRCS})
add_dependencies(${SO} ${PROGRAM_NAME})
# For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
-1
View File
@@ -164,7 +164,6 @@ MailInfo *MailMemoBegin(NickCore * nc)
getstring(MEMO_MAIL_SUBJECT));
return mail;
}
return NULL;
}
/*************************************************************************/
-4
View File
@@ -549,8 +549,6 @@ int delMessage(MessageHash * msgTable[], Message * m)
current->m = tail->next;
}
return MOD_ERR_OK;
last = tail;
tail = tail->next;
}
} else {
msgTable[index] = current->next;
@@ -567,8 +565,6 @@ int delMessage(MessageHash * msgTable[], Message * m)
current->m = tail->next;
}
return MOD_ERR_OK;
last = tail;
tail = tail->next;
}
} else {
lastHash->next = current->next;
+10 -8
View File
@@ -33,10 +33,11 @@ foreach(SRC ${MODULES_SRCS})
set(TEMP_DEPENDENCIES)
# Calculate the library dependencies for the given source file
calculate_libraries(${SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES)
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
# For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
if(MSVC)
append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
set(WIN32_MEMORY win32_memory)
else(MSVC)
set(WIN32_MEMORY)
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
@@ -44,7 +45,7 @@ foreach(SRC ${MODULES_SRCS})
add_dependencies(${SO} ${PROGRAM_NAME})
# For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${TEMP_DEPENDENCIES})
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
@@ -113,10 +114,11 @@ foreach(FILE ${MODULES_FILES})
remove_list_duplicates(SUBDIR_EXTRA_DEPENDS)
endif(SUBDIR_EXTRA_DEPENDS)
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
# For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
if(MSVC)
append_to_list(MODULE_SUBDIR_SRCS ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
set(WIN32_MEMORY win32_memory)
else(MSVC)
set(WIN32_MEMORY)
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
@@ -125,7 +127,7 @@ foreach(FILE ${MODULES_FILES})
add_dependencies(${SO} ${PROGRAM_NAME})
# For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${SUBDIR_EXTRA_DEPENDS})
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
+5 -4
View File
@@ -27,10 +27,11 @@ foreach(SRC ${PROTOCOL_SRCS})
if(TEMP_INCLUDES)
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
endif(TEMP_INCLUDES)
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
# For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
if(MSVC)
append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
set_source_files_properties(${Anope_SOURCE_DIR}/src/win32_memory.cpp LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
set(WIN32_MEMORY win32_memory)
else(MSVC)
set(WIN32_MEMORY)
endif(MSVC)
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${SRC})
@@ -38,7 +39,7 @@ foreach(SRC ${PROTOCOL_SRCS})
add_dependencies(${SO} ${PROGRAM_NAME})
# For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Set the module to be installed to the module directory under the data directory
+1 -1
View File
@@ -341,7 +341,7 @@ void User::SendMessage(const char *source, const std::string &msg)
*/
void User::CheckAuthenticationToken(const char *svid)
{
const char *c;
const char *c = NULL;
NickAlias *na;
if ((na = findnick(this->nick)))
+1 -1
View File
@@ -75,7 +75,7 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
return !*wild;
}
CoreExport bool Anope::Match(const std::string &str, const std::string &mask, bool case_sensitive)
bool Anope::Match(const std::string &str, const std::string &mask, bool case_sensitive)
{
return match_internal(reinterpret_cast<const unsigned char *>(str.c_str()), reinterpret_cast<const unsigned char *>(mask.c_str()), case_sensitive);
}