diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 28932f9..210ca0e 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -907,7 +907,7 @@ void ArgumentParser::parseArgs(int argc, const char *const *argv, ParseArgumentB */ void ArgumentParser::readArgs(int argc, const char *const *argv) { - IF_DEBUG_BUILD(verifyArgs(m_mainArgs);) + CPP_UTILITIES_IF_DEBUG_BUILD(verifyArgs(m_mainArgs);) m_actualArgc = 0; // the first argument is the executable name @@ -1005,7 +1005,7 @@ bool ArgumentParser::isUncombinableMainArgPresent() const return false; } -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD /*! * \brief Verifies the specified \a argument definitions. * diff --git a/application/argumentparser.h b/application/argumentparser.h index d5eb064..610bee5 100644 --- a/application/argumentparser.h +++ b/application/argumentparser.h @@ -8,7 +8,7 @@ #include #include #include -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD #include #endif @@ -484,7 +484,7 @@ public: private: // declare internal operations - IF_DEBUG_BUILD(void verifyArgs(const ArgumentVector &args);) + CPP_UTILITIES_IF_DEBUG_BUILD(void verifyArgs(const ArgumentVector &args);) ArgumentCompletionInfo determineCompletionInfo( int argc, const char *const *argv, unsigned int currentWordIndex, const ArgumentReader &reader) const; std::string findSuggestions(int argc, const char *const *argv, unsigned int cursorPos, const ArgumentReader &reader) const; @@ -522,7 +522,7 @@ inline const char *Argument::name() const */ inline void Argument::setName(const char *name) { -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD if (name && *name) { assert(*name != '-'); for (const char *c = name; *c; ++c) { @@ -552,8 +552,8 @@ inline char Argument::abbreviation() const */ inline void Argument::setAbbreviation(char abbreviation) { - IF_DEBUG_BUILD(assert(abbreviation != ' ' && abbreviation != '=' && abbreviation != '-' && abbreviation != '\'' && abbreviation != '"' - && abbreviation != '\n' && abbreviation != '\r')); + CPP_UTILITIES_IF_DEBUG_BUILD(assert(abbreviation != ' ' && abbreviation != '=' && abbreviation != '-' && abbreviation != '\'' + && abbreviation != '"' && abbreviation != '\n' && abbreviation != '\r')); m_abbreviation = abbreviation; } diff --git a/application/global.h b/application/global.h index 20dc32b..4185398 100644 --- a/application/global.h +++ b/application/global.h @@ -1,5 +1,5 @@ -#ifndef APPLICATION_UTILITIES_GLOBAL_H -#define APPLICATION_UTILITIES_GLOBAL_H +#ifndef CPP_UTILITIES_APPLICATION_UTILITIES_GLOBAL_H +#define CPP_UTILITIES_APPLICATION_UTILITIES_GLOBAL_H #if defined(_WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) #ifndef PLATFORM_WINDOWS @@ -58,49 +58,48 @@ #endif /*! - * \def LIB_EXPORT + * \def CPP_UTILITIES_GENERIC_LIB_EXPORT * \brief Marks a symbol for shared library export. */ /*! - * \def LIB_IMPORT + * \def CPP_UTILITIES_GENERIC_LIB_IMPORT * \brief Declares a symbol to be an import from a shared library. */ /*! - * \def LIB_HIDDEN + * \def CPP_UTILITIES_GENERIC_LIB_HIDDEN * \brief Hidden visibility indicates that the symbol will not be placed into * the dynamic symbol table, so no other module (executable or shared library) * can reference it directly. */ #ifdef PLATFORM_WINDOWS -#define LIB_EXPORT __declspec(dllexport) -#define LIB_IMPORT __declspec(dllimport) -#define LIB_HIDDEN +#define CPP_UTILITIES_GENERIC_LIB_EXPORT __declspec(dllexport) +#define CPP_UTILITIES_GENERIC_LIB_IMPORT __declspec(dllimport) +#define CPP_UTILITIES_GENERIC_LIB_HIDDEN #else -#define LIB_EXPORT __attribute__((visibility("default"))) -#define LIB_IMPORT __attribute__((visibility("default"))) -#define LIB_HIDDEN __attribute__((visibility("hidden"))) +#define CPP_UTILITIES_GENERIC_LIB_EXPORT __attribute__((visibility("default"))) +#define CPP_UTILITIES_GENERIC_LIB_IMPORT __attribute__((visibility("default"))) +#define CPP_UTILITIES_GENERIC_LIB_HIDDEN __attribute__((visibility("hidden"))) #endif /*! - * \def VAR_UNUSED + * \def CPP_UTILITIES_UNUSED * \brief Prevents warnings about unused variables. */ -#define VAR_UNUSED(x) (void)x; +#define CPP_UTILITIES_UNUSED(x) (void)x; /*! - * \def IF_DEBUG_BUILD + * \def CPP_UTILITIES_IF_DEBUG_BUILD * \brief Wraps debug-only lines conveniently. */ -#ifdef DEBUG_BUILD -#define IF_DEBUG_BUILD(x) x +#ifdef CPP_UTILITIES_DEBUG_BUILD +#define CPP_UTILITIES_IF_DEBUG_BUILD(x) x #else -#define IF_DEBUG_BUILD(x) +#define CPP_UTILITIES_IF_DEBUG_BUILD(x) #endif - -#endif // APPLICATION_UTILITIES_GLOBAL_H +#endif // CPP_UTILITIES_APPLICATION_UTILITIES_GLOBAL_H diff --git a/cmake/modules/BasicConfig.cmake b/cmake/modules/BasicConfig.cmake index 6cf6495..700d013 100644 --- a/cmake/modules/BasicConfig.cmake +++ b/cmake/modules/BasicConfig.cmake @@ -190,7 +190,7 @@ endif () # enable debug-only code when doing a debug build if (CMAKE_BUILD_TYPE STREQUAL "Debug") - list(APPEND META_PRIVATE_COMPILE_DEFINITIONS DEBUG_BUILD) + list(APPEND META_PRIVATE_COMPILE_DEFINITIONS CPP_UTILITIES_DEBUG_BUILD) message(STATUS "Debug build enabled.") endif () diff --git a/cmake/templates/global.h.in b/cmake/templates/global.h.in index f2d4a52..fef609e 100644 --- a/cmake/templates/global.h.in +++ b/cmake/templates/global.h.in @@ -10,8 +10,8 @@ #define @META_PROJECT_VARNAME_UPPER@_EXPORT #define @META_PROJECT_VARNAME_UPPER@_IMPORT #else -#define @META_PROJECT_VARNAME_UPPER@_EXPORT LIB_EXPORT -#define @META_PROJECT_VARNAME_UPPER@_IMPORT LIB_IMPORT +#define @META_PROJECT_VARNAME_UPPER@_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define @META_PROJECT_VARNAME_UPPER@_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/global.h b/global.h index 9fe7855..218eca8 100644 --- a/global.h +++ b/global.h @@ -10,8 +10,8 @@ #define CPP_UTILITIES_EXPORT #define CPP_UTILITIES_IMPORT #else -#define CPP_UTILITIES_EXPORT LIB_EXPORT -#define CPP_UTILITIES_IMPORT LIB_IMPORT +#define CPP_UTILITIES_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define CPP_UTILITIES_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*!