diff --git a/CMakeLists.txt b/CMakeLists.txt index f87929d2..d16a6952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,6 +217,7 @@ set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.h" "${CMAKE_SOURCE_DIR}/src/backend/helpers/language.h" "${CMAKE_SOURCE_DIR}/src/backend/helpers/version.h" "${CMAKE_SOURCE_DIR}/src/backend/helpers/yaml_set_helpers.h" + "${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h" "${CMAKE_SOURCE_DIR}/include/loot/error.h" "${CMAKE_SOURCE_DIR}/include/loot/game_type.h" "${CMAKE_SOURCE_DIR}/include/loot/language_code.h" @@ -273,6 +274,7 @@ set (LOOT_API_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp" "${CMAKE_SOURCE_DIR}/src/api/api_database.cpp") set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.h" + "${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h" "${CMAKE_SOURCE_DIR}/include/loot/database_interface.h" "${CMAKE_SOURCE_DIR}/include/loot/error.h" "${CMAKE_SOURCE_DIR}/include/loot/game_type.h" diff --git a/include/loot/api.h b/include/loot/api.h index cfb9806e..ff43a830 100644 --- a/include/loot/api.h +++ b/include/loot/api.h @@ -32,27 +32,12 @@ #include #include +#include "loot/api_decorator.h" #include "loot/database_interface.h" #include "loot/error.h" #include "loot/game_type.h" #include "loot/loot_version.h" -/* set up dll import/export decorators - when compiling the dll on windows, ensure LOOT_EXPORT is defined. clients - that use this header do not need to define anything to import the symbols - properly. */ -#if defined(_WIN32) -# ifdef LOOT_STATIC -# define LOOT_API -# elif defined LOOT_EXPORT -# define LOOT_API __declspec(dllexport) -# else -# define LOOT_API __declspec(dllimport) -# endif -#else -# define LOOT_API -#endif - namespace loot { /**@}*/ /**********************************************************************//** diff --git a/include/loot/api_decorator.h b/include/loot/api_decorator.h new file mode 100644 index 00000000..4080d181 --- /dev/null +++ b/include/loot/api_decorator.h @@ -0,0 +1,44 @@ +/* LOOT + + A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and + Fallout: New Vegas. + + Copyright (C) 2013-2016 WrinklyNinja + + This file is part of LOOT. + + LOOT is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + LOOT is distributed in the hope that it will + be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LOOT. If not, see + . + */ + +#ifndef LOOT_API_DECORATOR +#define LOOT_API_DECORATOR + +/* set up dll import/export decorators + when compiling the dll on windows, ensure LOOT_EXPORT is defined. clients + that use this header do not need to define anything to import the symbols + properly. */ +#if defined(_WIN32) +# ifdef LOOT_STATIC +# define LOOT_API +# elif defined LOOT_EXPORT +# define LOOT_API __declspec(dllexport) +# else +# define LOOT_API __declspec(dllimport) +# endif +#else +# define LOOT_API +#endif + +#endif diff --git a/include/loot/error.h b/include/loot/error.h index c4ca159a..63c48bb3 100644 --- a/include/loot/error.h +++ b/include/loot/error.h @@ -28,22 +28,6 @@ #include #include -/* set up dll import/export decorators -when compiling the dll on windows, ensure LOOT_EXPORT is defined. clients -that use this header do not need to define anything to import the symbols -properly. */ -#if defined(_WIN32) -# ifdef LOOT_STATIC -# define LOOT_API -# elif defined LOOT_EXPORT -# define LOOT_API __declspec(dllexport) -# else -# define LOOT_API __declspec(dllimport) -# endif -#else -# define LOOT_API -#endif - /** * @file * @brief Contains the Error class used for some exceptions thrown. diff --git a/include/loot/loot_version.h b/include/loot/loot_version.h index 3ddf19e0..fe60796a 100644 --- a/include/loot/loot_version.h +++ b/include/loot/loot_version.h @@ -27,21 +27,7 @@ along with LOOT. If not, see #include -/* set up dll import/export decorators -when compiling the dll on windows, ensure LOOT_EXPORT is defined. clients -that use this header do not need to define anything to import the symbols -properly. */ -#if defined(_WIN32) -# ifdef LOOT_STATIC -# define LOOT_API -# elif defined LOOT_EXPORT -# define LOOT_API __declspec(dllexport) -# else -# define LOOT_API __declspec(dllimport) -# endif -#else -# define LOOT_API -#endif +#include "loot/api_decorator.h" /** * @file