summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/serialize.h2
-rw-r--r--modules/CMakeLists.txt4
-rw-r--r--modules/database/flatfile.cpp6
-rw-r--r--modules/database/redis.cpp5
-rw-r--r--src/serialize.cpp5
5 files changed, 11 insertions, 11 deletions
diff --git a/include/serialize.h b/include/serialize.h
index 8fbeb6615..73964e3b7 100644
--- a/include/serialize.h
+++ b/include/serialize.h
@@ -279,7 +279,7 @@ class CoreExport Serialize::TypeBase : public Service
static TypeBase *Find(const Anope::string &name);
- static const std::map<Anope::string, TypeBase *>& GetTypes();
+ static const std::vector<TypeBase *>& GetTypes();
};
template<typename T, typename Base = Serialize::TypeBase>
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index d48a57234..8feaa91dc 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -54,7 +54,7 @@ macro(build_modules SRC)
# Mark undefined symbols as having to be looked up at runtime
set(MOD_EXTRA_LDFLAGS "-undefined dynamic_lookup")
endif()
- set_target_properties(${TARG} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" OUTPUT_NAME "${OUT_NAME}" LINK_FLAGS "${TEMP_LDFLAGS} ${MOD_EXTRA_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON)
+ set_target_properties(${TARG} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX ".so" OUTPUT_NAME "${OUT_NAME}" LINK_FLAGS "${TEMP_LDFLAGS} ${MOD_EXTRA_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON)
add_dependencies(${TARG} ${PROGRAM_NAME})
if(GETTEXT_FOUND)
add_dependencies(${TARG} module_language)
@@ -159,7 +159,7 @@ macro(build_subdir)
# Generate the module and set its linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} SHARED ${MODULES_SUBDIR_SRCS})
- set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS} ${MOD_EXTRA_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON OUTPUT_NAME "${DIR_NAME}_${FOLDER_NAME}")
+ set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX ".so" LINK_FLAGS "${SUBDIR_LDFLAGS} ${MOD_EXTRA_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON OUTPUT_NAME "${DIR_NAME}_${FOLDER_NAME}")
add_dependencies(${SO} ${PROGRAM_NAME})
if(GETTEXT_FOUND)
add_dependencies(${SO} module_language)
diff --git a/modules/database/flatfile.cpp b/modules/database/flatfile.cpp
index b45a89d44..7e2d5e949 100644
--- a/modules/database/flatfile.cpp
+++ b/modules/database/flatfile.cpp
@@ -37,15 +37,11 @@ class DBFlatFile : public Module
{
last_day = tm->tm_mday;
- const std::map<Anope::string, Serialize::TypeBase *> &types = Serialize::TypeBase::GetTypes();
-
std::set<Anope::string> dbs;
dbs.insert(Config->GetModule(this)->Get<Anope::string>("database", "anope.db"));
- for (const std::pair<Anope::string, Serialize::TypeBase *> &p : types)
+ for (Serialize::TypeBase *stype : Serialize::TypeBase::GetTypes())
{
- Serialize::TypeBase *stype = p.second;
-
if (stype->GetOwner())
dbs.insert("module_" + stype->GetOwner()->name + ".db");
}
diff --git a/modules/database/redis.cpp b/modules/database/redis.cpp
index 21f7ca960..49ab8cbd4 100644
--- a/modules/database/redis.cpp
+++ b/modules/database/redis.cpp
@@ -92,9 +92,8 @@ class DatabaseRedis : public Module
if (!redis)
return EVENT_STOP;
- const std::map<Anope::string, Serialize::TypeBase *> &types = Serialize::TypeBase::GetTypes();
- for (const std::pair<Anope::string, Serialize::TypeBase *> &p : types)
- this->OnSerializeTypeCreate(p.second);
+ for (Serialize::TypeBase *type : Serialize::TypeBase::GetTypes())
+ this->OnSerializeTypeCreate(type);
while (redis->BlockAndProcess());
diff --git a/src/serialize.cpp b/src/serialize.cpp
index 099151191..1cf9bcb58 100644
--- a/src/serialize.cpp
+++ b/src/serialize.cpp
@@ -255,6 +255,11 @@ TypeBase *TypeBase::Find(const Anope::string &name)
return ServiceManager::Get()->FindService<TypeBase *>(name);
}
+const std::vector<TypeBase *>& TypeBase::GetTypes()
+{
+ return ServiceManager::Get()->FindServices<TypeBase *>();
+}
+
FieldBase::FieldBase(Module *c, const Anope::string &n, const Anope::string &t, bool d)
: Service(c, FieldBase::NAME)
, serialize_type(t)