diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 681f7a959..c41f2e8b5 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -157,6 +157,10 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF() +IF(WIN32 AND NOT WITH_STATIC2) + ADD_DEFINITIONS(-DNL_DLLEXP) +ENDIF() + IF(WITH_SSE2) ADD_DEFINITIONS(-DNL_HAS_SSE2) IF(WITH_SSE3) diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index 9de2e8214..8b79b7bfc 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -31,6 +31,10 @@ MACRO(NL_CONFIGURE_CHECKS) SET(NL_XAUDIO2_AVAILABLE 1) ENDIF() + IF(WIN32 AND NOT WITH_STATIC2) + SET(NL_DLLIMP 1) + ENDIF() + IF(NOT RYZOM_VERSION_MAJOR) SET(RYZOM_VERSION_MAJOR ${NL_VERSION_MAJOR}) SET(RYZOM_VERSION_MINOR ${NL_VERSION_MINOR}) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index bd70dd2ff..959935e58 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -30,6 +30,13 @@ MACRO(NL_TARGET_LIB name) ADD_LIBRARY(${name} SHARED ${ARGN}) ENDIF() ENDMACRO(NL_TARGET_LIB) +MACRO(NL_TARGET_LIB2 name) + IF(WITH_STATIC2) + ADD_LIBRARY(${name} STATIC ${ARGN}) + ELSE() + ADD_LIBRARY(${name} SHARED ${ARGN}) + ENDIF() +ENDMACRO(NL_TARGET_LIB2) ### # @@ -216,6 +223,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) ELSE() OPTION(WITH_STATIC "With static libraries." OFF) ENDIF() + OPTION(WITH_STATIC2 "With static libraries (porting support)." OFF) IF (WITH_STATIC) OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON ) ELSE() diff --git a/code/config.h.cmake b/code/config.h.cmake index 9d698ac08..86f620381 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -12,6 +12,8 @@ #cmakedefine NL_STEREO_AVAILABLE ${NL_STEREO_AVAILABLE} +#cmakedefine NL_DLLIMP ${NL_DLLIMP} + #cmakedefine NL_BIN_PREFIX "${NL_BIN_ABSOLUTE_PREFIX}" #cmakedefine NL_ETC_PREFIX "${NL_ETC_ABSOLUTE_PREFIX}" #cmakedefine NL_SHARE_PREFIX "${NL_SHARE_ABSOLUTE_PREFIX}" diff --git a/code/nel/include/nel/misc/aabbox.h b/code/nel/include/nel/misc/aabbox.h index 3e1ee05dd..2468c7158 100644 --- a/code/nel/include/nel/misc/aabbox.h +++ b/code/nel/include/nel/misc/aabbox.h @@ -38,7 +38,7 @@ class CMatrix; * \author Nevrax France * \date 2000 */ -class CAABBox +class NLMISC_API CAABBox { protected: /// The center of the bbox. diff --git a/code/nel/include/nel/misc/algo.h b/code/nel/include/nel/misc/algo.h index 50493538f..bd10339ce 100644 --- a/code/nel/include/nel/misc/algo.h +++ b/code/nel/include/nel/misc/algo.h @@ -82,12 +82,12 @@ T computeBilinear(const T &v0, const T &v1, const T &v2, const T &v3, const U &s /** Select all points crossed by the line [(x0,y0) ; (x1,y1)] * Not the same than brensenham */ -void drawFullLine (float x0, float y0, float x1, float y1, std::vector > &result); +NLMISC_API void drawFullLine(float x0, float y0, float x1, float y1, std::vector> &result); // *************************************************************************** /** Select points on the line [(x0,y0) ; (x1,y1)] */ -void drawLine (float x0, float y0, float x1, float y1, std::vector > &result); +NLMISC_API void drawLine(float x0, float y0, float x1, float y1, std::vector> &result); // *************************************************************************** @@ -177,18 +177,18 @@ static inline void fastClamp8(sint &v) * return false if wildcard has some "**" or "*?" * NB: case-sensitive */ -bool testWildCard(const char *strIn, const char *wildCard); +NLMISC_API bool testWildCard(const char *strIn, const char *wildCard); -bool testWildCard(const std::string &strIn, const std::string &wildCard); +NLMISC_API bool testWildCard(const std::string &strIn, const std::string &wildCard); // *************************************************************************** /** From a string with some separators, build a vector of string. * eg: splitString("hello|bye|||bee", "|", list) return 3 string into list: "hello", "bye" and "bee". */ -void splitString(const std::string &str, const std::string &separator, std::vector &retList); +NLMISC_API void splitString(const std::string &str, const std::string &separator, std::vector &retList); -void splitUCString(const ucstring &ucstr, const ucstring &separator, std::vector &retList); +NLMISC_API void splitUCString(const ucstring &ucstr, const ucstring &separator, std::vector &retList); // *************************************************************************** /// In a string or ucstring, find a substr and replace it with another. return true if replaced diff --git a/code/nel/include/nel/misc/app_context.h b/code/nel/include/nel/misc/app_context.h index bf73ddb83..2722146d4 100644 --- a/code/nel/include/nel/misc/app_context.h +++ b/code/nel/include/nel/misc/app_context.h @@ -41,7 +41,7 @@ namespace NLMISC * \author Boris 'SoniX' Boucher * \date 2005 */ - class INelContext + class NLMISC_API INelContext { static INelContext ** _getInstance(); public: diff --git a/code/nel/include/nel/misc/async_file_manager.h b/code/nel/include/nel/misc/async_file_manager.h index cbfbe97af..885d45bb6 100644 --- a/code/nel/include/nel/misc/async_file_manager.h +++ b/code/nel/include/nel/misc/async_file_manager.h @@ -31,7 +31,7 @@ namespace NLMISC * \author Nevrax France * \date 2002 */ -class CAsyncFileManager : public CTaskManager +class NLMISC_API CAsyncFileManager : public CTaskManager { NLMISC_SAFE_SINGLETON_DECL(CAsyncFileManager); CAsyncFileManager() {} diff --git a/code/nel/include/nel/misc/big_file.h b/code/nel/include/nel/misc/big_file.h index 95fc09b41..8c9201e2f 100644 --- a/code/nel/include/nel/misc/big_file.h +++ b/code/nel/include/nel/misc/big_file.h @@ -35,7 +35,7 @@ const uint32 BF_ALWAYS_OPENED = 0x00000001; const uint32 BF_CACHE_FILE_ON_OPEN = 0x00000002; // *************************************************************************** -class CBigFile +class NLMISC_API CBigFile { NLMISC_SAFE_SINGLETON_DECL(CBigFile); diff --git a/code/nel/include/nel/misc/bit_mem_stream.h b/code/nel/include/nel/misc/bit_mem_stream.h index 342508974..df6c12e0f 100644 --- a/code/nel/include/nel/misc/bit_mem_stream.h +++ b/code/nel/include/nel/misc/bit_mem_stream.h @@ -365,7 +365,7 @@ private: * \author Nevrax France * \date 2001, 2003 */ -class CBitMemStream : public CMemStream +class NLMISC_API CBitMemStream : public CMemStream { public: diff --git a/code/nel/include/nel/misc/bit_set.h b/code/nel/include/nel/misc/bit_set.h index 873bdf3ac..b37218355 100644 --- a/code/nel/include/nel/misc/bit_set.h +++ b/code/nel/include/nel/misc/bit_set.h @@ -37,7 +37,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CBitSet +class NLMISC_API CBitSet { public: /* *********************************************** diff --git a/code/nel/include/nel/misc/bitmap.h b/code/nel/include/nel/misc/bitmap.h index 7e5994152..5fa2d37c3 100644 --- a/code/nel/include/nel/misc/bitmap.h +++ b/code/nel/include/nel/misc/bitmap.h @@ -70,7 +70,7 @@ const uint8 MAX_MIPMAP = 16; * *** IF YOU MODIFY THE STRUCTURE OF THIS CLASS, PLEASE INCREMENT IDriver::InterfaceVersion TO INVALIDATE OLD DRIVER DLL * ********************************** */ -class CBitmap +class NLMISC_API CBitmap { protected : CObjectVector _Data[MAX_MIPMAP]; diff --git a/code/nel/include/nel/misc/block_memory.h b/code/nel/include/nel/misc/block_memory.h index 912f92d1c..cae4c685d 100644 --- a/code/nel/include/nel/misc/block_memory.h +++ b/code/nel/include/nel/misc/block_memory.h @@ -30,7 +30,7 @@ namespace NLMISC // *************************************************************************** /// See CBlockMemory::Purge -extern bool NL3D_BlockMemoryAssertOnPurge; // =true. +NLMISC_API extern bool NL3D_BlockMemoryAssertOnPurge; // =true. // *************************************************************************** diff --git a/code/nel/include/nel/misc/bsphere.h b/code/nel/include/nel/misc/bsphere.h index 05da12557..4a67f81da 100644 --- a/code/nel/include/nel/misc/bsphere.h +++ b/code/nel/include/nel/misc/bsphere.h @@ -33,7 +33,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CBSphere +class NLMISC_API CBSphere { public: CVector Center; diff --git a/code/nel/include/nel/misc/buf_fifo.h b/code/nel/include/nel/misc/buf_fifo.h index 50da6e030..c91d96611 100644 --- a/code/nel/include/nel/misc/buf_fifo.h +++ b/code/nel/include/nel/misc/buf_fifo.h @@ -60,7 +60,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class CBufFIFO +class NLMISC_API CBufFIFO { public: diff --git a/code/nel/include/nel/misc/cdb.h b/code/nel/include/nel/misc/cdb.h index 46fcc4849..a818f2b23 100644 --- a/code/nel/include/nel/misc/cdb.h +++ b/code/nel/include/nel/misc/cdb.h @@ -44,7 +44,7 @@ class CCDBBankHandler; * \date 2002 */ -class ICDBNode : public CRefCount +class NLMISC_API ICDBNode : public CRefCount { //----------------------------------------------------------------------- // end of IDBNode interface diff --git a/code/nel/include/nel/misc/cdb_bank_handler.h b/code/nel/include/nel/misc/cdb_bank_handler.h index 155c2abac..bd79c0f17 100644 --- a/code/nel/include/nel/misc/cdb_bank_handler.h +++ b/code/nel/include/nel/misc/cdb_bank_handler.h @@ -32,7 +32,8 @@ namespace NLMISC{ and the other way around. */ -class CCDBBankHandler{ +class NLMISC_API CCDBBankHandler +{ public: /** @brief The class' constructor diff --git a/code/nel/include/nel/misc/cdb_branch.h b/code/nel/include/nel/misc/cdb_branch.h index f8a979499..546d4431f 100644 --- a/code/nel/include/nel/misc/cdb_branch.h +++ b/code/nel/include/nel/misc/cdb_branch.h @@ -31,7 +31,7 @@ namespace NLMISC{ * \author Nevrax France * \date 2002 */ -class CCDBNodeBranch : public ICDBNode +class NLMISC_API CCDBNodeBranch : public ICDBNode { public: diff --git a/code/nel/include/nel/misc/cdb_branch_observing_handler.h b/code/nel/include/nel/misc/cdb_branch_observing_handler.h index 69fb2bf9a..4d86c310f 100644 --- a/code/nel/include/nel/misc/cdb_branch_observing_handler.h +++ b/code/nel/include/nel/misc/cdb_branch_observing_handler.h @@ -28,7 +28,8 @@ namespace NLMISC{ The marked observers can then be notified and flushed on request. */ - class CCDBBranchObservingHandler{ +class NLMISC_API CCDBBranchObservingHandler +{ enum{ MAX_OBS_LST = 2 diff --git a/code/nel/include/nel/misc/cdb_check_sum.h b/code/nel/include/nel/misc/cdb_check_sum.h index 126656ce3..4aae7eeed 100644 --- a/code/nel/include/nel/misc/cdb_check_sum.h +++ b/code/nel/include/nel/misc/cdb_check_sum.h @@ -32,7 +32,7 @@ namespace NLMISC{ * \author Nevrax France * \date 2002 */ -class CCDBCheckSum +class NLMISC_API CCDBCheckSum { public: ///constructor diff --git a/code/nel/include/nel/misc/cdb_leaf.h b/code/nel/include/nel/misc/cdb_leaf.h index c80ec903a..adb10b3f5 100644 --- a/code/nel/include/nel/misc/cdb_leaf.h +++ b/code/nel/include/nel/misc/cdb_leaf.h @@ -32,7 +32,7 @@ namespace NLMISC{ * \author Nevrax France * \date 2002 */ -class CCDBNodeLeaf : public ICDBNode +class NLMISC_API CCDBNodeLeaf : public ICDBNode { public: // flush all observers calls for modified nodes diff --git a/code/nel/include/nel/misc/cdb_manager.h b/code/nel/include/nel/misc/cdb_manager.h index 3d8caa3a8..8a4044bc1 100644 --- a/code/nel/include/nel/misc/cdb_manager.h +++ b/code/nel/include/nel/misc/cdb_manager.h @@ -26,7 +26,8 @@ namespace NLMISC{ /// Class that encapsulates the separate CDB components - class CCDBManager{ +class NLMISC_API CCDBManager +{ public: /** diff --git a/code/nel/include/nel/misc/check_fpu.h b/code/nel/include/nel/misc/check_fpu.h index 853b2a3d4..fa7a8658a 100644 --- a/code/nel/include/nel/misc/check_fpu.h +++ b/code/nel/include/nel/misc/check_fpu.h @@ -22,7 +22,7 @@ namespace NLMISC { -class CFpuChecker +class NLMISC_API CFpuChecker { private: static int _RefFpuCtrl; diff --git a/code/nel/include/nel/misc/class_id.h b/code/nel/include/nel/misc/class_id.h index 5222bad49..97d652a89 100644 --- a/code/nel/include/nel/misc/class_id.h +++ b/code/nel/include/nel/misc/class_id.h @@ -33,8 +33,8 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CClassId -{ + class NLMISC_API CClassId + { uint64 Uid; public: diff --git a/code/nel/include/nel/misc/class_registry.h b/code/nel/include/nel/misc/class_registry.h index 98139f5dc..54060a770 100644 --- a/code/nel/include/nel/misc/class_registry.h +++ b/code/nel/include/nel/misc/class_registry.h @@ -76,7 +76,7 @@ public: * \author Nevrax France * \date 2000 */ -class CClassRegistry +class NLMISC_API CClassRegistry { public: /// Inits the ClassRegistry (especially RegistredClasses) diff --git a/code/nel/include/nel/misc/cmd_args.h b/code/nel/include/nel/misc/cmd_args.h index 3fb87e0c0..2f2760a9f 100644 --- a/code/nel/include/nel/misc/cmd_args.h +++ b/code/nel/include/nel/misc/cmd_args.h @@ -28,7 +28,7 @@ namespace NLMISC { -class CCmdArgs +class NLMISC_API CCmdArgs { public: CCmdArgs(); diff --git a/code/nel/include/nel/misc/co_task.h b/code/nel/include/nel/misc/co_task.h index 80542834e..acf3829ed 100644 --- a/code/nel/include/nel/misc/co_task.h +++ b/code/nel/include/nel/misc/co_task.h @@ -114,7 +114,7 @@ namespace NLMISC * * */ - class CCoTask + class NLMISC_API CCoTask { /// Flag stating if the task is started or not bool _Started; diff --git a/code/nel/include/nel/misc/command.h b/code/nel/include/nel/misc/command.h index 443690e9f..8e03de347 100644 --- a/code/nel/include/nel/misc/command.h +++ b/code/nel/include/nel/misc/command.h @@ -95,7 +95,7 @@ bool __category##_##__name##Class::execute(const std::string &rawCommandString, * \author Nevrax France * \date 2001 */ -class ICommand +class NLMISC_API ICommand { public: diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 350abc7f3..dea2e3e72 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -172,18 +172,18 @@ template inline void contReset (T& a) * raiseToNextPowerOf2(8) is 8 * raiseToNextPowerOf2(5) is 8 */ -uint raiseToNextPowerOf2 (uint v); +NLMISC_API uint raiseToNextPowerOf2(uint v); /** Return the power of 2 of v. * Example: * getPowerOf2(8) is 3 * getPowerOf2(5) is 3 */ -uint getPowerOf2 (uint v); +NLMISC_API uint getPowerOf2(uint v); /** Return \c true if the value is a power of 2. */ -bool isPowerOf2 (sint32 v); +NLMISC_API bool isPowerOf2(sint32 v); /** Converts from degrees to radians @@ -222,37 +222,37 @@ inline double isValidDouble (double v) * \param str a string to transform to lower case */ -std::string toLower ( const char *str ); -std::string toLower ( const std::string &str ); -void toLower ( char *str ); -char toLower ( const char ch ); // convert only one character +NLMISC_API std::string toLower(const char *str); +NLMISC_API std::string toLower(const std::string &str); +NLMISC_API void toLower(char *str); +NLMISC_API char toLower(const char ch); // convert only one character /** Convert a string in upper case. * \param a string to transform to upper case */ -std::string toUpper ( const std::string &str); -void toUpper ( char *str); +NLMISC_API std::string toUpper(const std::string &str); +NLMISC_API void toUpper(char *str); /** * Convert to an hexadecimal std::string */ -std::string toHexa(const uint8 &b); -std::string toHexa(const uint8 *data, uint size); -std::string toHexa(const std::string &str); -std::string toHexa(const char *str); +NLMISC_API std::string toHexa(const uint8 &b); +NLMISC_API std::string toHexa(const uint8 *data, uint size); +NLMISC_API std::string toHexa(const std::string &str); +NLMISC_API std::string toHexa(const char *str); /** * Convert from an hexadecimal std::string */ -bool fromHexa(const std::string &hexa, uint8 &b); -bool fromHexa(const std::string &hexa, uint8 *data); -bool fromHexa(const std::string &hexa, std::string &str); -bool fromHexa(const char *hexa, uint8 &b); -bool fromHexa(const char *hexa, uint8 *data); -bool fromHexa(const char *hexa, std::string &str); -bool fromHexa(const char hexa, uint8 &b); +NLMISC_API bool fromHexa(const std::string &hexa, uint8 &b); +NLMISC_API bool fromHexa(const std::string &hexa, uint8 *data); +NLMISC_API bool fromHexa(const std::string &hexa, std::string &str); +NLMISC_API bool fromHexa(const char *hexa, uint8 &b); +NLMISC_API bool fromHexa(const char *hexa, uint8 *data); +NLMISC_API bool fromHexa(const char *hexa, std::string &str); +NLMISC_API bool fromHexa(const char hexa, uint8 &b); // Remove all the characters <= 32 (tab, space, new line, return, vertical tab etc..) at the beginning and at the end of a string template T trim (const T &str) @@ -323,20 +323,20 @@ inline float nlroundf(float x) #endif // Wrapper for fopen to be able to open files with an UTF-8 filename -FILE *nlfopen(const std::string &filename, const std::string &mode); +NLMISC_API FILE *nlfopen(const std::string &filename, const std::string &mode); /** Signed 64 bit fseek. Same interface as fseek */ -int nlfseek64(FILE *stream, sint64 offset, int origin); +NLMISC_API int nlfseek64(FILE *stream, sint64 offset, int origin); // Retrieve position in a file, same interface as ftell -sint64 nlftell64(FILE *stream); +NLMISC_API sint64 nlftell64(FILE *stream); /** * Base class for all NeL exception. * It enables to construct simple string at the ctor. */ -class Exception : public std::exception +class NLMISC_API Exception : public std::exception { protected: std::string _Reason; @@ -353,7 +353,7 @@ public: * Portable Sleep() function that suspends the execution of the calling thread for a number of milliseconds. * Note: the resolution of the timer is system-dependant and may be more than 1 millisecond. */ -void nlSleep( uint32 ms ); +NLMISC_API void nlSleep(uint32 ms); /// Returns Process Id (note: on Linux, Process Id is the same as the Thread Id) @@ -362,73 +362,73 @@ void nlSleep( uint32 ms ); #endif /// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) -size_t getThreadId(); +NLMISC_API size_t getThreadId(); /// Returns a readable string from a vector of bytes. unprintable char are replaced by '?' -std::string stringFromVector( const std::vector& v, bool limited = true ); +NLMISC_API std::string stringFromVector(const std::vector &v, bool limited = true); /// Convert a string into an sint64 (same as atoi() function but for 64 bits intergers) -sint64 atoiInt64 (const char *ident, sint64 base = 10); +NLMISC_API sint64 atoiInt64(const char *ident, sint64 base = 10); /// Convert an sint64 into a string (same as itoa() function but for 64 bits intergers) -void itoaInt64 (sint64 number, char *str, sint64 base = 10); +NLMISC_API void itoaInt64(sint64 number, char *str, sint64 base = 10); /// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb" -std::string bytesToHumanReadable (const std::string &bytes); -std::string bytesToHumanReadable (uint64 bytes); +NLMISC_API std::string bytesToHumanReadable(const std::string &bytes); +NLMISC_API std::string bytesToHumanReadable(uint64 bytes); /// Convert a number in bytes into a string that is easily readable by an human, for example 105123 -> "102kb" /// Using units array as string: 0 => B, 1 => KiB, 2 => MiB, 3 => GiB, etc... -std::string bytesToHumanReadableUnits (uint64 bytes, const std::vector &units); +NLMISC_API std::string bytesToHumanReadableUnits(uint64 bytes, const std::vector &units); /// Convert a human readable into a bytes, for example "102kb" -> 105123 -uint32 humanReadableToBytes (const std::string &str); +NLMISC_API uint32 humanReadableToBytes(const std::string &str); /// Convert a time into a string that is easily readable by an human, for example 3600 -> "1h" -std::string secondsToHumanReadable (uint32 time); +NLMISC_API std::string secondsToHumanReadable(uint32 time); /// Convert a UNIX timestamp to a formatted date in ISO format -std::string timestampToHumanReadable(uint32 timestamp); +NLMISC_API std::string timestampToHumanReadable(uint32 timestamp); /// Get a bytes or time in string format and convert it in seconds or bytes -uint32 fromHumanReadable (const std::string &str); +NLMISC_API uint32 fromHumanReadable(const std::string &str); /// Add digit grouping seperator to if value >= 10 000. Assumes input is numerical string. -std::string formatThousands(const std::string& s); +NLMISC_API std::string formatThousands(const std::string &s); /// This function executes a program in the background and returns instantly (used for example to launch services in AES). /// The program will be launched in the current directory -bool launchProgram (const std::string &programName, const std::string &arguments, bool log = true); +NLMISC_API bool launchProgram(const std::string &programName, const std::string &arguments, bool log = true); /// Same but with an array of strings for arguments -bool launchProgramArray (const std::string &programName, const std::vector &arguments, bool log = true); +NLMISC_API bool launchProgramArray(const std::string &programName, const std::vector &arguments, bool log = true); /// This function executes a program and wait for result (used for example for crash report). /// The program will be launched in the current directory -sint launchProgramAndWaitForResult (const std::string &programName, const std::string &arguments, bool log = true); +NLMISC_API sint launchProgramAndWaitForResult(const std::string &programName, const std::string &arguments, bool log = true); /// This function executes a program and returns output as a string -std::string getCommandOutput(const std::string &command); +NLMISC_API std::string getCommandOutput(const std::string &command); /// This function replace all environment variables in a string by their content. /// Environment variables names can use both Windows (%NAME%) and UNIX syntax ($NAME) /// Authorized characters in names are A-Z, a-z, 0-9 and _ -std::string expandEnvironmentVariables(const std::string &s); +NLMISC_API std::string expandEnvironmentVariables(const std::string &s); /// Functions to convert a string with arguments to array or array to string (will espace strings with spaces) bool explodeArguments(const std::string &str, std::vector &args); -std::string joinArguments(const std::vector &args); +NLMISC_API std::string joinArguments(const std::vector &args); /// Escape an argument to not evaluate environment variables or special cases -std::string escapeArgument(const std::string &arg); +NLMISC_API std::string escapeArgument(const std::string &arg); /// This function kills a program using his pid (on unix, it uses the kill() POSIX function) -bool killProgram(uint32 pid); +NLMISC_API bool killProgram(uint32 pid); /// This function kills a program using his pid with abort signal (on unix, it uses the kill() POSIX function) -bool abortProgram(uint32 pid); +NLMISC_API bool abortProgram(uint32 pid); /** Returns a string corresponding to the class T in string format. * Example: @@ -702,10 +702,10 @@ operator<<(std::basic_ostream<_CharT, _Traits>& __os, const sint64& __z) class CLog; /// Display the bits (with 0 and 1) composing a byte (from right to left) -void displayByteBits( uint8 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log ); +NLMISC_API void displayByteBits(uint8 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log); /// Display the bits (with 0 and 1) composing a number (uint32) (from right to left) -void displayDwordBits( uint32 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log ); +NLMISC_API void displayDwordBits(uint32 b, uint nbits, sint beginpos, bool displayBegin, NLMISC::CLog *log); /// this wrapping is due to a visual bug when calling isprint with big value /// example of crash with VC6 SP4: int a = isprint(0x40e208); @@ -720,10 +720,10 @@ inline int nlisprint(int c) #endif // Open an url in a browser -bool openURL (const std::string &url); +NLMISC_API bool openURL(const std::string &url); // Open a document -bool openDoc (const std::string &document); +NLMISC_API bool openDoc(const std::string &document); // AntiBug method that return an epsilon if x==0, else x inline float favoid0(float x) diff --git a/code/nel/include/nel/misc/config_file.h b/code/nel/include/nel/misc/config_file.h index 0bfdd2eaf..e67778881 100644 --- a/code/nel/include/nel/misc/config_file.h +++ b/code/nel/include/nel/misc/config_file.h @@ -107,7 +107,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CConfigFile +class NLMISC_API CConfigFile { public: diff --git a/code/nel/include/nel/misc/contiguous_block_allocator.h b/code/nel/include/nel/misc/contiguous_block_allocator.h index 43d6fac09..b32304d06 100644 --- a/code/nel/include/nel/misc/contiguous_block_allocator.h +++ b/code/nel/include/nel/misc/contiguous_block_allocator.h @@ -40,7 +40,7 @@ namespace NLMISC * \date 2004 * */ -class CContiguousBlockAllocator +class NLMISC_API CContiguousBlockAllocator { public: // ctor diff --git a/code/nel/include/nel/misc/cpu_time_stat.h b/code/nel/include/nel/misc/cpu_time_stat.h index 292aab8a6..c84de2436 100644 --- a/code/nel/include/nel/misc/cpu_time_stat.h +++ b/code/nel/include/nel/misc/cpu_time_stat.h @@ -35,7 +35,7 @@ namespace NLMISC * \author Nevrax France * \date 2004 */ -class CCPUTimeStat +class NLMISC_API CCPUTimeStat { public: diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index d01c85f1c..8fb47ea05 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -45,7 +45,7 @@ namespace NLMISC * Btw the method is optimized like this (1 call instead of 3 (and one with virtual)) because we added a local cache (_Log) * Thus it is much better like this. */ -class CImposterLog +class NLMISC_API CImposterLog { private: typedef CLog *(INelContext::*TAccessor)(); @@ -66,14 +66,14 @@ public: // NOTE: The following are all NULL until createDebug() has been called at least once // NOTE2: You must not use this class before the main() (not inside a static class ctor) -extern CImposterLog ErrorLog; -extern CImposterLog WarningLog; -extern CImposterLog InfoLog; -extern CImposterLog DebugLog; -extern CImposterLog AssertLog; +NLMISC_API extern CImposterLog ErrorLog; +NLMISC_API extern CImposterLog WarningLog; +NLMISC_API extern CImposterLog InfoLog; +NLMISC_API extern CImposterLog DebugLog; +NLMISC_API extern CImposterLog AssertLog; -extern CMemDisplayer *DefaultMemDisplayer; -extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer; +NLMISC_API extern CMemDisplayer *DefaultMemDisplayer; +NLMISC_API extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer; // @@ -81,36 +81,36 @@ extern CMsgBoxDisplayer *DefaultMsgBoxDisplayer; // // internal use only -void createDebug (const char *logPath = NULL, bool logInFile = true, bool eraseLastLog = false); +NLMISC_API void createDebug(const char *logPath = NULL, bool logInFile = true, bool eraseLastLog = false); /// Do not call this, unless you know what you're trying to do (it kills debug)! -void destroyDebug(); +NLMISC_API void destroyDebug(); // call this if you want to change the dir of the log.log file -void changeLogDirectory(const std::string &dir); +NLMISC_API void changeLogDirectory(const std::string &dir); // call this if you want to get the dir of the log.log file -std::string getLogDirectory(); +NLMISC_API std::string getLogDirectory(); // internal breakpoint window -void enterBreakpoint (const char *message); +NLMISC_API void enterBreakpoint(const char *message); // if true, the assert generates an assert // if false, the assert just displays a warning and continue -void setAssert (bool assert); +NLMISC_API void setAssert(bool assert); // Beep (Windows only, no effect elsewhere) -void beep( uint freq, uint duration ); +NLMISC_API void beep(uint freq, uint duration); -typedef std::string (*TCrashCallback)(); +NLMISC_API typedef std::string (*TCrashCallback)(); // this function enables user application to add information in the log when a crash occurs -void setCrashCallback(TCrashCallback crashCallback); +NLMISC_API void setCrashCallback(TCrashCallback crashCallback); // For Crash report window. allow to know if a crash has already raised in the application -bool isCrashAlreadyReported(); -void setCrashAlreadyReported(bool state); +NLMISC_API bool isCrashAlreadyReported(); +NLMISC_API void setCrashAlreadyReported(bool state); // This very amazing macro __FUNCTION__ doesn't exist on VC6, map it to NULL @@ -175,7 +175,7 @@ void setCrashAlreadyReported(bool state); # define nldebug 0&& # endif #else // NL_NO_DEBUG - extern bool DisableNLDebug; +NLMISC_API extern bool DisableNLDebug; # define nldebug if (NLMISC::DisableNLDebug) {} else (NLMISC::createDebug(), NLMISC::INelContext::getInstance().getDebugLog()->setPosition( __LINE__, __FILE__, __FUNCTION__ ), NLMISC::INelContext::getInstance().getDebugLog())->displayNL #endif // NL_NO_DEBUG @@ -359,9 +359,9 @@ void setCrashAlreadyReported(bool state); #endif // Internal, don't use it (make smaller assert code) -extern bool _assert_stop(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); -extern void _assertex_stop_0(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); -extern bool _assertex_stop_1(bool &ignoreNextTime); +NLMISC_API extern bool _assert_stop(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); +NLMISC_API extern void _assertex_stop_0(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); +NLMISC_API extern bool _assertex_stop_1(bool &ignoreNextTime); // removed because we always check assert (even in release mode) #if defined(NL_DEBUG) @@ -542,10 +542,10 @@ class ETrapDebug : public Exception /// Get the call stack and set it with result -void getCallStack(std::string &result, sint skipNFirst = 0); +NLMISC_API void getCallStack(std::string &result, sint skipNFirst = 0); /// Get the call stack and the logs and set it with result -void getCallStackAndLog (std::string &result, sint skipNFirst = 0); +NLMISC_API void getCallStackAndLog(std::string &result, sint skipNFirst = 0); /** * safe_cast<>: this is a function which nlassert() a dynamic_cast in Debug, and just do a static_cast in release. @@ -610,10 +610,10 @@ template inline T type_cast(U o) */ // Need a breakpoint in the assert / verify macro -extern bool DebugNeedAssert; +NLMISC_API extern bool DebugNeedAssert; // Internal process, don't use it -extern bool NoAssert; +NLMISC_API extern bool NoAssert; template @@ -672,7 +672,7 @@ private: }; /// Data for instance counting -struct TInstanceCounterData +struct NLMISC_API TInstanceCounterData { sint32 _InstanceCounter; sint32 _DeltaCounter; @@ -864,20 +864,20 @@ private: // /// Never use this function (internal use only) -void nlFatalError (const char *format, ...); +NLMISC_API void nlFatalError(const char *format, ...); /// Never use this function but call the nlerror macro (internal use only) -void nlError (const char *format, ...); +NLMISC_API void nlError(const char *format, ...); #define NL_CRASH_DUMP_FILE "nel_debug.dmp" // Standard API to retrieve error code and test for windows or unix platform /// Return the last error code generated by a system call -int getLastError(); +NLMISC_API int getLastError(); /// Return a readable text according to the error code submited -std::string formatErrorMessage(int errorCode); +NLMISC_API std::string formatErrorMessage(int errorCode); //------------------------------------------------------------------------------------------------- diff --git a/code/nel/include/nel/misc/diff_tool.h b/code/nel/include/nel/misc/diff_tool.h index e122137cf..0e94361b6 100644 --- a/code/nel/include/nel/misc/diff_tool.h +++ b/code/nel/include/nel/misc/diff_tool.h @@ -528,21 +528,21 @@ namespace STRING_MANAGER typedef CMakeDiff TWorkSheetDiff; - uint64 makePhraseHash(const TPhrase &phrase); - bool parseHashFromComment(const ucstring &comments, uint64 &hashValue); + NLMISC_API uint64 makePhraseHash(const TPhrase &phrase); + NLMISC_API bool parseHashFromComment(const ucstring &comments, uint64 &hashValue); - bool loadStringFile(const std::string filename, std::vector &stringInfos, bool forceRehash, ucchar openMark = '[', ucchar closeMark = ']', bool specialCase = false); - ucstring prepareStringFile(const std::vector &strings, bool removeDiffComments, bool noDiffInfo = false); + NLMISC_API bool loadStringFile(const std::string filename, std::vector &stringInfos, bool forceRehash, ucchar openMark = '[', ucchar closeMark = ']', bool specialCase = false); + NLMISC_API ucstring prepareStringFile(const std::vector &strings, bool removeDiffComments, bool noDiffInfo = false); - bool readPhraseFile(const std::string &filename, std::vector &phrases, bool forceRehash); - bool readPhraseFileFromString(ucstring const& doc, const std::string &filename, std::vector &phrases, bool forceRehash); - ucstring tabLines(uint nbTab, const ucstring &str); - ucstring preparePhraseFile(const std::vector &phrases, bool removeDiffComments); + NLMISC_API bool readPhraseFile(const std::string &filename, std::vector &phrases, bool forceRehash); + NLMISC_API bool readPhraseFileFromString(ucstring const &doc, const std::string &filename, std::vector &phrases, bool forceRehash); + NLMISC_API ucstring tabLines(uint nbTab, const ucstring &str); + NLMISC_API ucstring preparePhraseFile(const std::vector &phrases, bool removeDiffComments); - bool loadExcelSheet(const std::string filename, TWorksheet &worksheet, bool checkUnique = true); - bool readExcelSheet(const ucstring &text, TWorksheet &worksheet, bool checkUnique = true); - void makeHashCode(TWorksheet &sheet, bool forceRehash); - ucstring prepareExcelSheet(const TWorksheet &worksheet); + NLMISC_API bool loadExcelSheet(const std::string filename, TWorksheet &worksheet, bool checkUnique = true); + NLMISC_API bool readExcelSheet(const ucstring &text, TWorksheet &worksheet, bool checkUnique = true); + NLMISC_API void makeHashCode(TWorksheet &sheet, bool forceRehash); + NLMISC_API ucstring prepareExcelSheet(const TWorksheet &worksheet); } // namespace STRING_MANAGER diff --git a/code/nel/include/nel/misc/displayer.h b/code/nel/include/nel/misc/displayer.h index 50dbeff25..43a3e20a0 100644 --- a/code/nel/include/nel/misc/displayer.h +++ b/code/nel/include/nel/misc/displayer.h @@ -37,7 +37,7 @@ class CMutex; * \author Nevrax France * \date 2000 */ -class IDisplayer +class NLMISC_API IDisplayer { public: @@ -90,7 +90,7 @@ private: * \author Nevrax France * \date 2000 */ -class CStdDisplayer : virtual public IDisplayer +class NLMISC_API CStdDisplayer : virtual public IDisplayer { public: CStdDisplayer (const char *displayerName = "") : IDisplayer (displayerName) {} @@ -110,7 +110,7 @@ protected: * \author Nevrax France * \date 2000 */ -class CFileDisplayer : virtual public IDisplayer +class NLMISC_API CFileDisplayer : virtual public IDisplayer { public: @@ -147,7 +147,7 @@ private: * \author Nevrax France * \date 2000 */ -class CMsgBoxDisplayer : virtual public IDisplayer +class NLMISC_API CMsgBoxDisplayer : virtual public IDisplayer { public: CMsgBoxDisplayer (const char *displayerName = "") : IDisplayer (displayerName), IgnoreNextTime(false) {} diff --git a/code/nel/include/nel/misc/dummy_window.h b/code/nel/include/nel/misc/dummy_window.h index 0993aebaa..82ae49cd8 100644 --- a/code/nel/include/nel/misc/dummy_window.h +++ b/code/nel/include/nel/misc/dummy_window.h @@ -53,7 +53,7 @@ namespace NLMISC * \author Nevrax France * \date 2007 */ -class CDummyWindow +class NLMISC_API CDummyWindow { public: CDummyWindow(); diff --git a/code/nel/include/nel/misc/dynloadlib.h b/code/nel/include/nel/misc/dynloadlib.h index 63719f423..e526a683a 100644 --- a/code/nel/include/nel/misc/dynloadlib.h +++ b/code/nel/include/nel/misc/dynloadlib.h @@ -89,7 +89,7 @@ extern "C" \ * \author Nevrax France * \date 2004 */ -class CLibrary +class NLMISC_API CLibrary { /// Dynamic library handle NL_LIB_HANDLE _LibHandle; @@ -200,7 +200,7 @@ public: * and to add some hooks for library implementor * over library loading/unloading. */ -class INelLibrary +class NLMISC_API INelLibrary { friend class CLibrary; diff --git a/code/nel/include/nel/misc/eid_translator.h b/code/nel/include/nel/misc/eid_translator.h index 54303c16a..89d72949e 100644 --- a/code/nel/include/nel/misc/eid_translator.h +++ b/code/nel/include/nel/misc/eid_translator.h @@ -30,7 +30,7 @@ namespace NLMISC { -class CEntityIdTranslator +class NLMISC_API CEntityIdTranslator { NLMISC_SAFE_SINGLETON_DECL_PTR(CEntityIdTranslator); public: diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 8999b170a..3b486844d 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -30,7 +30,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -struct CEntityId +struct NLMISC_API CEntityId { // pseudo constants enum diff --git a/code/nel/include/nel/misc/eval_num_expr.h b/code/nel/include/nel/misc/eval_num_expr.h index 8551e49df..36f64fea0 100644 --- a/code/nel/include/nel/misc/eval_num_expr.h +++ b/code/nel/include/nel/misc/eval_num_expr.h @@ -25,7 +25,7 @@ namespace NLMISC /** * This class performs numerical expression parsing. */ -class CEvalNumExpr +class NLMISC_API CEvalNumExpr { public: virtual ~CEvalNumExpr() {} diff --git a/code/nel/include/nel/misc/event_emitter_multi.h b/code/nel/include/nel/misc/event_emitter_multi.h index e41ee2055..03ce89b7a 100644 --- a/code/nel/include/nel/misc/event_emitter_multi.h +++ b/code/nel/include/nel/misc/event_emitter_multi.h @@ -29,7 +29,7 @@ namespace NLMISC { * This is useful when you don't have the opportunity to register more than * one event emitter to an event server. */ -class CEventEmitterMulti : public IEventEmitter +class NLMISC_API CEventEmitterMulti : public IEventEmitter { public: /// dtor diff --git a/code/nel/include/nel/misc/event_listener.h b/code/nel/include/nel/misc/event_listener.h index 5c1a4f59f..1849008ea 100644 --- a/code/nel/include/nel/misc/event_listener.h +++ b/code/nel/include/nel/misc/event_listener.h @@ -33,7 +33,7 @@ class CEventServer; * \author Nevrax France * \date 2000 */ -class IEventListener +class NLMISC_API IEventListener { public: diff --git a/code/nel/include/nel/misc/event_server.h b/code/nel/include/nel/misc/event_server.h index 65bb39ae5..4dd534df0 100644 --- a/code/nel/include/nel/misc/event_server.h +++ b/code/nel/include/nel/misc/event_server.h @@ -40,7 +40,7 @@ typedef std::multimap mapListe * \author Nevrax France * \date 2000 */ -class CEventServer +class NLMISC_API CEventServer { mapListener _Listeners; std::list _Emitters; diff --git a/code/nel/include/nel/misc/events.h b/code/nel/include/nel/misc/events.h index c783a85eb..cce563b78 100644 --- a/code/nel/include/nel/misc/events.h +++ b/code/nel/include/nel/misc/events.h @@ -33,7 +33,7 @@ class IEventEmitter; * CEvent. System event. * \date 2000 */ -class CEvent : public CClassId +class NLMISC_API CEvent : public CClassId { public: /// Emitter of the event. Can be NULL if the event is posted directly to the CEventServer. diff --git a/code/nel/include/nel/misc/fast_floor.h b/code/nel/include/nel/misc/fast_floor.h index 6cb8e209c..9fa69afbe 100644 --- a/code/nel/include/nel/misc/fast_floor.h +++ b/code/nel/include/nel/misc/fast_floor.h @@ -25,9 +25,9 @@ namespace NLMISC { const uint OptFastFloorCWStackSize = 10; -extern int OptFastFloorCWStack[OptFastFloorCWStackSize]; -extern int *OptFastFloorCWStackPtr; -extern int *OptFastFloorCWStackEnd; +NLMISC_API extern int OptFastFloorCWStack[OptFastFloorCWStackSize]; +NLMISC_API extern int *OptFastFloorCWStackPtr; +NLMISC_API extern int *OptFastFloorCWStackEnd; // fastFloor function. #if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) && defined(NL_USE_FASTFLOOR) @@ -35,7 +35,7 @@ extern int *OptFastFloorCWStackEnd; #include // The magic constant value. support both positive and negative numbers. -extern double OptFastFloorMagicConst ; +NLMISC_API extern double OptFastFloorMagicConst; inline void OptFastFloorPushCW(int ctrl) { diff --git a/code/nel/include/nel/misc/fast_mem.h b/code/nel/include/nel/misc/fast_mem.h index 66e04959a..9b9f5cbee 100644 --- a/code/nel/include/nel/misc/fast_mem.h +++ b/code/nel/include/nel/misc/fast_mem.h @@ -32,7 +32,7 @@ namespace NLMISC * \author Nevrax France * \date 2002 */ -class CFastMem +class NLMISC_API CFastMem { public: diff --git a/code/nel/include/nel/misc/file.h b/code/nel/include/nel/misc/file.h index 78dba95c6..edd1d95ec 100644 --- a/code/nel/include/nel/misc/file.h +++ b/code/nel/include/nel/misc/file.h @@ -80,7 +80,7 @@ struct ERenameError : public EFile * It can be loaded/called through CAsyncFileManager for instance * *********************************************** */ -class CIFile : public IStream +class NLMISC_API CIFile : public IStream { public: // Basic Usage. /// Object. NB: destructor close() the stream. @@ -198,7 +198,7 @@ private: * \author Nevrax France * \date 2000 */ -class COFile : public IStream +class NLMISC_API COFile : public IStream { public: // Basic Usage. /// Object. NB: destructor close() the stream. diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index 643217f5d..34df2330e 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -37,7 +37,7 @@ namespace NLMISC * \author Nevrax France * \date 2004 */ -class CFixedSizeAllocator +class NLMISC_API CFixedSizeAllocator { public: CFixedSizeAllocator(uint numBytesPerBlock, uint numBlockPerChunk); diff --git a/code/nel/include/nel/misc/grid_traversal.h b/code/nel/include/nel/misc/grid_traversal.h index 893b3978a..a8d7292a0 100644 --- a/code/nel/include/nel/misc/grid_traversal.h +++ b/code/nel/include/nel/misc/grid_traversal.h @@ -30,7 +30,7 @@ class CVector2f; * \author Nevrax France * \date 2005 */ -class CGridTraversal +class NLMISC_API CGridTraversal { public: /** begin to traverse a grid along the given segments diff --git a/code/nel/include/nel/misc/heap_memory.h b/code/nel/include/nel/misc/heap_memory.h index 0aeb3aec5..2a7722724 100644 --- a/code/nel/include/nel/misc/heap_memory.h +++ b/code/nel/include/nel/misc/heap_memory.h @@ -34,7 +34,7 @@ namespace NLMISC * \author Nevrax France * \date 2001 */ -class CHeapMemory +class NLMISC_API CHeapMemory { public: diff --git a/code/nel/include/nel/misc/hierarchical_timer.h b/code/nel/include/nel/misc/hierarchical_timer.h index 1c1818c69..2e704e15a 100644 --- a/code/nel/include/nel/misc/hierarchical_timer.h +++ b/code/nel/include/nel/misc/hierarchical_timer.h @@ -88,7 +88,7 @@ namespace NLMISC * \author Nevrax France * \date 2002 */ -class CSimpleClock +class NLMISC_API CSimpleClock { public: CSimpleClock() : _NumTicks(0) @@ -175,7 +175,7 @@ private: * \author Nevrax France * \date 2001, 2002 */ -class CHTimer +class NLMISC_API CHTimer { public: // this enum is used to sort displayed results diff --git a/code/nel/include/nel/misc/i18n.h b/code/nel/include/nel/misc/i18n.h index d50313357..2b1ed1f52 100644 --- a/code/nel/include/nel/misc/i18n.h +++ b/code/nel/include/nel/misc/i18n.h @@ -60,7 +60,7 @@ namespace NLMISC { * \date 2000 */ -class CI18N +class NLMISC_API CI18N { public: diff --git a/code/nel/include/nel/misc/i_xml.h b/code/nel/include/nel/misc/i_xml.h index 75d4e9bde..31d3a9f13 100644 --- a/code/nel/include/nel/misc/i_xml.h +++ b/code/nel/include/nel/misc/i_xml.h @@ -84,7 +84,7 @@ struct EXmlParsingError : public EStream * \author Nevrax France * \date 2001 */ -class CIXml : public IStream +class NLMISC_API CIXml : public IStream { friend void xmlGenericErrorFuncRead (void *ctx, const char *msg, ...); public: diff --git a/code/nel/include/nel/misc/inter_window_msg_queue.h b/code/nel/include/nel/misc/inter_window_msg_queue.h index 501105f61..2e81ec2ac 100644 --- a/code/nel/include/nel/misc/inter_window_msg_queue.h +++ b/code/nel/include/nel/misc/inter_window_msg_queue.h @@ -78,7 +78,7 @@ namespace NLMISC * . */ -class CInterWindowMsgQueue +class NLMISC_API CInterWindowMsgQueue { public: CInterWindowMsgQueue(); diff --git a/code/nel/include/nel/misc/line.h b/code/nel/include/nel/misc/line.h index e9ed8abb1..65f1c1c88 100644 --- a/code/nel/include/nel/misc/line.h +++ b/code/nel/include/nel/misc/line.h @@ -33,7 +33,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CLine +class NLMISC_API CLine { public: CVector V0, V1; diff --git a/code/nel/include/nel/misc/log.h b/code/nel/include/nel/misc/log.h index 6ac12e5b9..b702b8ece 100644 --- a/code/nel/include/nel/misc/log.h +++ b/code/nel/include/nel/misc/log.h @@ -40,7 +40,8 @@ class IDisplayer; * \author Nevrax France * \date 2001 */ -class CLog { +class NLMISC_API CLog +{ public: typedef enum { LOG_NO=0, LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG, LOG_STAT, LOG_ASSERT, LOG_UNKNOWN } TLogType; diff --git a/code/nel/include/nel/misc/matrix.h b/code/nel/include/nel/misc/matrix.h index 649d53324..1dd252081 100644 --- a/code/nel/include/nel/misc/matrix.h +++ b/code/nel/include/nel/misc/matrix.h @@ -54,7 +54,7 @@ class CPlane; * \date 2000 */ -class NL_ALIGN_SSE2 CMatrix +class NLMISC_API NL_ALIGN_SSE2 CMatrix { public: /// Rotation Order. diff --git a/code/nel/include/nel/misc/md5.h b/code/nel/include/nel/misc/md5.h index e5ca38f38..a65059941 100644 --- a/code/nel/include/nel/misc/md5.h +++ b/code/nel/include/nel/misc/md5.h @@ -59,7 +59,7 @@ class IStream; */ // **************************************************************************** -struct CHashKeyMD5 +struct NLMISC_API CHashKeyMD5 { uint8 Data[16]; @@ -74,7 +74,7 @@ struct CHashKeyMD5 }; // **************************************************************************** -class CMD5Context +class NLMISC_API CMD5Context { public: @@ -117,10 +117,10 @@ inline bool operator <(const struct CHashKeyMD5 &a,const struct CHashKeyMD5 &b) */ // This function get a filename (it works with big files) and returns his MD5 hash key -CHashKeyMD5 getMD5(const std::string &filename); +NLMISC_API CHashKeyMD5 getMD5(const std::string &filename); // This function get a buffer with size and returns his MD5 hash key -CHashKeyMD5 getMD5(const uint8 *buffer, uint32 size); +NLMISC_API CHashKeyMD5 getMD5(const uint8 *buffer, uint32 size); }; // namespace NLMISC diff --git a/code/nel/include/nel/misc/mem_displayer.h b/code/nel/include/nel/misc/mem_displayer.h index 62b74a7b9..6365a8872 100644 --- a/code/nel/include/nel/misc/mem_displayer.h +++ b/code/nel/include/nel/misc/mem_displayer.h @@ -33,7 +33,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class CMemDisplayer : public IDisplayer +class NLMISC_API CMemDisplayer : public IDisplayer { public: /// Constructor diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index 4222e1672..c027d1365 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -130,7 +130,7 @@ public: * \author Nevrax France * \date 2000, 2002 */ -class CMemStream : public NLMISC::IStream +class NLMISC_API CMemStream : public NLMISC::IStream { public: diff --git a/code/nel/include/nel/misc/mouse_smoother.h b/code/nel/include/nel/misc/mouse_smoother.h index 18d741996..1985d2f0b 100644 --- a/code/nel/include/nel/misc/mouse_smoother.h +++ b/code/nel/include/nel/misc/mouse_smoother.h @@ -33,7 +33,7 @@ namespace NLMISC * \author Nevrax France * \date 1/2004 */ -class CMouseSmoother +class NLMISC_API CMouseSmoother { public: // create a mouse smoother with the given sampling period. diff --git a/code/nel/include/nel/misc/mutex.h b/code/nel/include/nel/misc/mutex.h index ec9c89ceb..8c1122fc8 100644 --- a/code/nel/include/nel/misc/mutex.h +++ b/code/nel/include/nel/misc/mutex.h @@ -84,7 +84,7 @@ namespace NLMISC { * \author Nevrax France * \date 2000 */ -class CUnfairMutex +class NLMISC_API CUnfairMutex { public: @@ -424,7 +424,7 @@ private: * \author Nevrax France * \date 2002 */ -class CSharedMutex +class NLMISC_API CSharedMutex { public: @@ -504,7 +504,7 @@ struct TNelRtlCriticalSection { * \author Nevrax France * \date 2001 */ -class CFairMutex +class NLMISC_API CFairMutex { public: diff --git a/code/nel/include/nel/misc/noise_value.h b/code/nel/include/nel/misc/noise_value.h index bf72ab3a7..803dbb454 100644 --- a/code/nel/include/nel/misc/noise_value.h +++ b/code/nel/include/nel/misc/noise_value.h @@ -37,7 +37,7 @@ namespace NLMISC * \author Nevrax France * \date 2001 */ -class CNoiseValue +class NLMISC_API CNoiseValue { public: float Abs; diff --git a/code/nel/include/nel/misc/o_xml.h b/code/nel/include/nel/misc/o_xml.h index 80b60149d..5bfcf1e00 100644 --- a/code/nel/include/nel/misc/o_xml.h +++ b/code/nel/include/nel/misc/o_xml.h @@ -76,7 +76,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class COXml : public IStream +class NLMISC_API COXml : public IStream { friend int xmlOutputWriteCallbackForNeL ( void *context, const char *buffer, int len ); friend int xmlOutputCloseCallbackForNeL ( void *context ); diff --git a/code/nel/include/nel/misc/object_arena_allocator.h b/code/nel/include/nel/misc/object_arena_allocator.h index 09216aada..45b762483 100644 --- a/code/nel/include/nel/misc/object_arena_allocator.h +++ b/code/nel/include/nel/misc/object_arena_allocator.h @@ -35,7 +35,7 @@ class CFixedSizeAllocator; * \author Nevrax France * \date 2004 */ -class CObjectArenaAllocator +class NLMISC_API CObjectArenaAllocator { public: /** ctor diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index f42acc91b..ef59c1344 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -40,7 +40,7 @@ struct EPathNotFound : public Exception * \warning addSearchPath(), clearMap() and remapExtension() are not reentrant. * \warning all path and files are *case sensitive* on linux. */ -class CFileContainer +class NLMISC_API CFileContainer { // no copy allowed CFileContainer(const CFileContainer &/* other */) @@ -336,7 +336,7 @@ private: * \author Nevrax France * \date 2001 */ -class CPath +class NLMISC_API CPath { NLMISC_SAFE_SINGLETON_DECL_PTR(CPath); public: @@ -568,7 +568,7 @@ private: * \author Nevrax France * \date 2001 */ -struct CFile +struct NLMISC_API CFile { /** * Retrieve the associated file name. diff --git a/code/nel/include/nel/misc/plane.h b/code/nel/include/nel/misc/plane.h index 077a29a94..b7bf59491 100644 --- a/code/nel/include/nel/misc/plane.h +++ b/code/nel/include/nel/misc/plane.h @@ -38,7 +38,7 @@ class CUV; * \author Nevrax France * \date 2000 */ -class CPlane +class NLMISC_API CPlane { public: float a,b,c,d; diff --git a/code/nel/include/nel/misc/polygon.h b/code/nel/include/nel/misc/polygon.h index 08889c26d..81a85ac53 100644 --- a/code/nel/include/nel/misc/polygon.h +++ b/code/nel/include/nel/misc/polygon.h @@ -41,7 +41,7 @@ class CBSPNode2v; * \author Nevrax France * \date 2000 */ -class CPolygon +class NLMISC_API CPolygon { public: std::vector Vertices; diff --git a/code/nel/include/nel/misc/progress_callback.h b/code/nel/include/nel/misc/progress_callback.h index 0f22b4423..097149398 100644 --- a/code/nel/include/nel/misc/progress_callback.h +++ b/code/nel/include/nel/misc/progress_callback.h @@ -29,7 +29,7 @@ namespace NLMISC { * \author Nevrax France * \date 2002 */ -class IProgressCallback +class NLMISC_API IProgressCallback { public: diff --git a/code/nel/include/nel/misc/quat.h b/code/nel/include/nel/misc/quat.h index 6703a1455..6f4a73d66 100644 --- a/code/nel/include/nel/misc/quat.h +++ b/code/nel/include/nel/misc/quat.h @@ -39,7 +39,7 @@ const double QuatEpsilon= 0.000001; * \author Nevrax France * \date 2000 */ -struct CAngleAxis +struct NLMISC_API CAngleAxis { CVector Axis; /// an axis. float Angle; /// angle in radians. diff --git a/code/nel/include/nel/misc/reader_writer.h b/code/nel/include/nel/misc/reader_writer.h index 70c8d7e52..ec9d98518 100644 --- a/code/nel/include/nel/misc/reader_writer.h +++ b/code/nel/include/nel/misc/reader_writer.h @@ -29,7 +29,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class CReaderWriter +class NLMISC_API CReaderWriter { private: diff --git a/code/nel/include/nel/misc/rect.h b/code/nel/include/nel/misc/rect.h index 73a3cd911..5ecc0b411 100644 --- a/code/nel/include/nel/misc/rect.h +++ b/code/nel/include/nel/misc/rect.h @@ -31,7 +31,7 @@ class CVector2f; * \author Nevrax France * \date 2000 */ -class CRect +class NLMISC_API CRect { public: /// default ctor diff --git a/code/nel/include/nel/misc/report.h b/code/nel/include/nel/misc/report.h index 55a1c2dbf..bdd9b8d8d 100644 --- a/code/nel/include/nel/misc/report.h +++ b/code/nel/include/nel/misc/report.h @@ -49,10 +49,10 @@ enum TReportResult * * \return the button clicked or defaultResult */ -TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult); +NLMISC_API TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult); /// Set the Url of the web service used to post crash reports to. String is copied -void setReportPostUrl(const char *postUrl); +NLMISC_API void setReportPostUrl(const char *postUrl); } // NLMISC diff --git a/code/nel/include/nel/misc/rgba.h b/code/nel/include/nel/misc/rgba.h index 006b1f102..48faa2411 100644 --- a/code/nel/include/nel/misc/rgba.h +++ b/code/nel/include/nel/misc/rgba.h @@ -34,7 +34,7 @@ class IStream; * \author Nevrax France * \date 2000 */ -class CRGBA +class NLMISC_API CRGBA { public: diff --git a/code/nel/include/nel/misc/sha1.h b/code/nel/include/nel/misc/sha1.h index ae42c3c1e..a378e380b 100644 --- a/code/nel/include/nel/misc/sha1.h +++ b/code/nel/include/nel/misc/sha1.h @@ -101,12 +101,12 @@ inline bool operator <(const struct CHashKey &a,const struct CHashKey &b) // This function get a filename (it works with big files) and returns his SHA hash key // when forcePath is true, it doesn't use NLMISC::lookup -CHashKey getSHA1(const std::string &filename, bool forcePath = false); +NLMISC_API CHashKey getSHA1(const std::string &filename, bool forcePath = false); // This function get a buffer with size and returns his SHA hash key -CHashKey getSHA1(const uint8 *buffer, uint32 size); +NLMISC_API CHashKey getSHA1(const uint8 *buffer, uint32 size); // This function get a buffer and key with size and returns his HMAC-SHA1 hash key -CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len); +NLMISC_API CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len); #endif // NL_SHA1_H diff --git a/code/nel/include/nel/misc/shared_memory.h b/code/nel/include/nel/misc/shared_memory.h index 34e3c36f4..51c052afa 100644 --- a/code/nel/include/nel/misc/shared_memory.h +++ b/code/nel/include/nel/misc/shared_memory.h @@ -56,7 +56,7 @@ typedef key_t TSharedMemId; * \author Nevrax France * \date 2002 */ -class CSharedMemory +class NLMISC_API CSharedMemory { public: diff --git a/code/nel/include/nel/misc/sheet_id.h b/code/nel/include/nel/misc/sheet_id.h index 8db0470af..f66ec1ed3 100644 --- a/code/nel/include/nel/misc/sheet_id.h +++ b/code/nel/include/nel/misc/sheet_id.h @@ -43,7 +43,7 @@ namespace NLMISC { * \author Nevrax France * \date 2002 */ -class CSheetId +class NLMISC_API CSheetId { public : diff --git a/code/nel/include/nel/misc/smart_ptr.h b/code/nel/include/nel/misc/smart_ptr.h index b0fc1c301..1c470a0ba 100644 --- a/code/nel/include/nel/misc/smart_ptr.h +++ b/code/nel/include/nel/misc/smart_ptr.h @@ -37,7 +37,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CRefCount +class NLMISC_API CRefCount { public: /// Destructor which release pinfo if necessary. diff --git a/code/nel/include/nel/misc/sstring.h b/code/nel/include/nel/misc/sstring.h index a8b231012..a971de385 100644 --- a/code/nel/include/nel/misc/sstring.h +++ b/code/nel/include/nel/misc/sstring.h @@ -41,167 +41,167 @@ typedef std::vector CVectorSString; * \author Nevrax * \date 2003 */ -class CSString: public std::string +class CSString : public std::string { public: /// ctor - CSString(); + NLMISC_API CSString(); /// ctor - CSString(const char *s); + NLMISC_API CSString(const char *s); /// ctor - CSString(const std::string &s); + NLMISC_API CSString(const std::string &s); /// ctor - CSString(char c); + NLMISC_API CSString(char c); /// ctor - CSString(int i,const char *fmt="%d"); + NLMISC_API CSString(int i, const char *fmt = "%d"); /// ctor - CSString(uint32 u,const char *fmt="%u"); + NLMISC_API CSString(uint32 u, const char *fmt = "%u"); /// ctor - CSString(double d,const char *fmt="%f"); + NLMISC_API CSString(double d, const char *fmt = "%f"); /// ctor - CSString(const char *s,const char *fmt); + NLMISC_API CSString(const char *s, const char *fmt); /// ctor - CSString(const std::string &s,const char *fmt); + NLMISC_API CSString(const std::string &s, const char *fmt); /// ctor - CSString(const std::vector& v,const std::string& separator="\n"); + NLMISC_API CSString(const std::vector &v, const std::string &separator = "\n"); /// Const [] operator - std::string::const_reference operator[](std::string::size_type idx) const; + NLMISC_API std::string::const_reference operator[](std::string::size_type idx) const; /// Non-Const [] operator - std::string::reference operator[](std::string::size_type idx); + NLMISC_API std::string::reference operator[](std::string::size_type idx); /// Return the first character, or '\\0' is the string is empty - char operator*(); + NLMISC_API char operator*(); /// Return the n right hand most characters of a string - char back() const; + NLMISC_API char back() const; /// Return the n left hand most characters of a string - CSString left(uint32 count) const; + NLMISC_API CSString left(uint32 count) const; /// Return the n right hand most characters of a string - CSString right(uint32 count) const; + NLMISC_API CSString right(uint32 count) const; /// Return the string minus the n left hand most characters of a string - CSString leftCrop(uint32 count) const; + NLMISC_API CSString leftCrop(uint32 count) const; /// Return the string minus the n right hand most characters of a string - CSString rightCrop(uint32 count) const; + NLMISC_API CSString rightCrop(uint32 count) const; /// Return sub string up to but not including first instance of given character, starting at 'iterator' /// on exit 'iterator' indexes first character after extracted string segment - CSString splitToWithIterator(char c,uint32& iterator) const; + NLMISC_API CSString splitToWithIterator(char c, uint32 &iterator) const; /// Return sub string up to but not including first instance of given character - CSString splitTo(char c) const; + NLMISC_API CSString splitTo(char c) const; /// Return sub string up to but not including first instance of given character - CSString splitTo(char c,bool truncateThis=false,bool absorbSeparator=true); + NLMISC_API CSString splitTo(char c, bool truncateThis = false, bool absorbSeparator = true); /// Return sub string up to but not including first instance of given character - CSString splitTo(const char *s,bool truncateThis=false); + NLMISC_API CSString splitTo(const char *s, bool truncateThis = false); /// Return sub string up to but not including first non-quote encapsulated '//' - CSString splitToLineComment(bool truncateThis=false, bool useSlashStringEscape=true); + NLMISC_API CSString splitToLineComment(bool truncateThis = false, bool useSlashStringEscape = true); /// Return sub string from character following first instance of given character on - CSString splitFrom(char c) const; + NLMISC_API CSString splitFrom(char c) const; /// Return sub string from character following first instance of given character on - CSString splitFrom(const char *s) const; + NLMISC_API CSString splitFrom(const char *s) const; /// Behave like a s strtok() routine, returning the sun string extracted from (and removed from) *this - CSString strtok(const char *separators, + NLMISC_API CSString strtok(const char *separators, bool useSmartExtensions=false, // if true then match brackets etc (and refine with following args) bool useAngleBrace=false, // - treat '<' and '>' as brackets bool useSlashStringEscape=true, // - treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true); // - treat """" as '"') /// Return first word (blank separated) - can remove extracted word from source string - CSString firstWord(bool truncateThis=false); + NLMISC_API CSString firstWord(bool truncateThis = false); /// Return first word (blank separated) - CSString firstWordConst() const; + NLMISC_API CSString firstWordConst() const; /// Return sub string remaining after the first word - CSString tailFromFirstWord() const; + NLMISC_API CSString tailFromFirstWord() const; /// Count the number of words in a string - uint32 countWords() const; + NLMISC_API uint32 countWords() const; /// Extract the given word - CSString word(uint32 idx) const; + NLMISC_API CSString word(uint32 idx) const; /// Return first word or quote-encompassed sub-string - can remove extracted sub-string from source string - CSString firstWordOrWords(bool truncateThis=false,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true); + NLMISC_API CSString firstWordOrWords(bool truncateThis = false, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true); /// Return first word or quote-encompassed sub-string - CSString firstWordOrWordsConst(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; + NLMISC_API CSString firstWordOrWordsConst(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const; /// Return sub string following first word (or quote-encompassed sub-string) - CSString tailFromFirstWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; + NLMISC_API CSString tailFromFirstWordOrWords(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const; /// Count the number of words (or quote delimited sub-strings) in a string - uint32 countWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; + NLMISC_API uint32 countWordOrWords(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const; /// Extract the given words (or quote delimited sub-strings) - CSString wordOrWords(uint32 idx,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; + NLMISC_API CSString wordOrWords(uint32 idx, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const; /// Return first line - can remove extracted line from source string - CSString firstLine(bool truncateThis=false); + NLMISC_API CSString firstLine(bool truncateThis = false); /// Return first line - CSString firstLineConst() const; + NLMISC_API CSString firstLineConst() const; /// Return sub string remaining after the first line - CSString tailFromFirstLine() const; + NLMISC_API CSString tailFromFirstLine() const; /// Count the number of lines in a string - uint32 countLines() const; + NLMISC_API uint32 countLines() const; /// Extract the given line - CSString line(uint32 idx) const; + NLMISC_API CSString line(uint32 idx) const; /// A handy utility routine for knowing if a character is a white space character or not (' ','\t','\n','\r',26) - static bool isWhiteSpace(char c); + NLMISC_API static bool isWhiteSpace(char c); /// Test whether character matches '{', '(','[' or '<' (the '<' test depends on the useAngleBrace parameter - static bool isOpeningDelimiter(char c,bool useAngleBrace=false); + NLMISC_API static bool isOpeningDelimiter(char c, bool useAngleBrace = false); /// Test whether character matches '}', ')',']' or '>' (the '>' test depends on the useAngleBrace parameter - static bool isClosingDelimiter(char c,bool useAngleBrace=false); + NLMISC_API static bool isClosingDelimiter(char c, bool useAngleBrace = false); /// Test whether character matches '\'' or '\"' - static bool isStringDelimiter(char c); + NLMISC_API static bool isStringDelimiter(char c); /// Tests whether the character 'b' is the closing delimiter or string delimiter corresponding to character 'a' - static bool isMatchingDelimiter(char a,char b); + NLMISC_API static bool isMatchingDelimiter(char a, char b); /// A handy utility routine for knowing if a character is a valid component of a file name - static bool isValidFileNameChar(char c); + NLMISC_API static bool isValidFileNameChar(char c); /// A handy utility routine for knowing if a character is a valid first char for a keyword (a..z, '_') - static bool isValidKeywordFirstChar(char c); + NLMISC_API static bool isValidKeywordFirstChar(char c); /// A handy utility routine for knowing if a character is a valid subsequent char for a keyword (a..z, '_', '0'..'9') - static bool isValidKeywordChar(char c); + NLMISC_API static bool isValidKeywordChar(char c); /// A handy utility routine for knowing if a character is printable (isValidFileNameChar + more basic punctuation) - static bool isPrintable(char c); + NLMISC_API static bool isPrintable(char c); /// A handy utility routine for knowing if a character is a hex digit 0..9, a..f - static bool isHexDigit(char c); + NLMISC_API static bool isHexDigit(char c); /// A handy utility routine for converting a hex digit to a numeric value 0..15 - static char convertHexDigit(char c); + NLMISC_API static char convertHexDigit(char c); // a handy routine that tests whether a given string contains binary characters or not. Only characters>32 + isWhiteSpace() are valid - bool isValidText(); + NLMISC_API bool isValidText(); // a handy routine that tests whether a given string is a valid file name or not // "\"hello there\\bla\"" is valid // "hello there\\bla" is not valid - missing quotes // "\"hello there\"\\bla" is not valid - text after quotes - bool isValidFileName() const; + NLMISC_API bool isValidFileName() const; // a second handy routine that tests whether a given string is a valid file name or not // equivalent to ('\"'+*this+'\"').isValidFileName() // "\"hello there\\bla\"" is not valid - too many quotes // "hello there\\bla" is valid - bool isValidUnquotedFileName() const; + NLMISC_API bool isValidUnquotedFileName() const; // a handy routine that tests whether or not a given string is a valid keyword - bool isValidKeyword() const; + NLMISC_API bool isValidKeyword() const; // a handy routine that tests whether or not a given string is quote encapsulated - bool isQuoted( bool useAngleBrace=false, // treat '<' and '>' as brackets + NLMISC_API bool isQuoted(bool useAngleBrace = false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' /// Search for the closing delimiter matching the opening delimiter at position 'startPos' in the 'this' string /// on error returns startPos - uint32 findMatchingDelimiterPos(bool useAngleBrace,bool useSlashStringEscape,bool useRepeatQuoteStringEscape,uint32 startPos=0) const; + NLMISC_API uint32 findMatchingDelimiterPos(bool useAngleBrace, bool useSlashStringEscape, bool useRepeatQuoteStringEscape, uint32 startPos = 0) const; /// Extract a chunk from the 'this' string /// if first non-blank character is a string delimiter or an opening delimiter then extracts up to the matching closing delimiter /// in all other cases an empty string is returned /// the return string includes the opening blank characters (it isn't stripped) - CSString matchDelimiters(bool truncateThis=false, + NLMISC_API CSString matchDelimiters(bool truncateThis = false, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true); // treat """" as '"' /// copy out section of string up to separator character, respecting quotes (but not brackets etc) /// on error tail after returned string doesn't begin with valid separator character - CSString splitToStringSeparator( char separator, + NLMISC_API CSString splitToStringSeparator(char separator, bool truncateThis=false, bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"' @@ -210,14 +210,14 @@ public: /// copy out section of string up to separator character, respecting quotes, brackets, etc /// on error tail after returned string doesn't begin with valid separator character /// eg: splitToSeparator(','); - this might be used to split some sort of ',' separated input - CSString splitToSeparator( char separator, + NLMISC_API CSString splitToSeparator(char separator, bool truncateThis=false, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"' bool truncateSeparatorCharacter=false); // if true tail begins after separator char - CSString splitToSeparator( char separator, + NLMISC_API CSString splitToSeparator(char separator, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' @@ -225,7 +225,7 @@ public: /// copy out section of string up to any of a given set of separator characters, respecting quotes, brackets, etc /// on error tail after returned string doesn't begin with valid separator character /// eg: splitToOneOfSeparators(",;",true,false,false,true); - this might be used to split a string read from a CSV file - CSString splitToOneOfSeparators( const CSString& separators, + NLMISC_API CSString splitToOneOfSeparators(const CSString &separators, bool truncateThis=false, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' @@ -233,14 +233,14 @@ public: bool truncateSeparatorCharacter=false, // if true tail begins after separator char bool splitStringAtBrackets=true); // if true consider brackets as breaks in the string - CSString splitToOneOfSeparators( const CSString& separators, + NLMISC_API CSString splitToOneOfSeparators(const CSString &separators, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true) const; // treat """" as '"' /// Return true if the string is a single block encompassed by a pair of delimiters /// eg: "((a)(b)(c))" or "(abc)" return true wheras "(a)(b)(c)" or "abc" return false - bool isDelimitedMonoBlock( bool useAngleBrace=false, // treat '<' and '>' as brackets + NLMISC_API bool isDelimitedMonoBlock(bool useAngleBrace = false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; @@ -248,26 +248,26 @@ public: /// Return the sub string with leading and trailing delimiters ( such as '(' and ')' or '[' and ']' ) removed /// if the string isn't a delimited monoblock then the complete string is returned /// eg "((a)b(c))" returns "(a)b(c)" whereas "(a)b(c)" returns the identical "(a)b(c)" - CSString stripBlockDelimiters( bool useAngleBrace=false, // treat '<' and '>' as brackets + NLMISC_API CSString stripBlockDelimiters(bool useAngleBrace = false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; /// Append the individual words in the string to the result vector /// retuns true on success - bool splitWords(CVectorSString& result) const; + NLMISC_API bool splitWords(CVectorSString &result) const; /// Append the individual "wordOrWords" elements in the string to the result vector /// retuns true on success - bool splitWordOrWords(CVectorSString& result,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const; + NLMISC_API bool splitWordOrWords(CVectorSString &result, bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape = true) const; /// Append the individual lines in the string to the result vector /// retuns true on success - bool splitLines(CVectorSString& result) const; + NLMISC_API bool splitLines(CVectorSString &result) const; /// Append the separator-separated elements in the string to the result vector /// retuns true on success - bool splitBySeparator( char separator, CVectorSString& result, + NLMISC_API bool splitBySeparator(char separator, CVectorSString &result, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"' @@ -276,7 +276,7 @@ public: /// Append the separator-separated elements in the string to the result vector /// retuns true on success - bool splitByOneOfSeparators( const CSString& separators, CVectorSString& result, + NLMISC_API bool splitByOneOfSeparators(const CSString &separators, CVectorSString &result, bool useAngleBrace=false, // treat '<' and '>' as brackets bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true, // treat """" as '"' @@ -286,142 +286,142 @@ public: /// join an array of strings to form a single string (appends to the existing content of this string) /// if this string is not empty then a separator is added between this string and the following - const CSString& join(const std::vector& strings, const CSString& separator=""); - const CSString& join(const std::vector& strings, char separator); + NLMISC_API const CSString &join(const std::vector &strings, const CSString &separator = ""); + NLMISC_API const CSString &join(const std::vector &strings, char separator); /// Return a copy of the string with leading and trainling spaces removed - CSString strip() const; + NLMISC_API CSString strip() const; /// Return a copy of the string with leading spaces removed - CSString leftStrip() const; + NLMISC_API CSString leftStrip() const; /// Return a copy of the string with trainling spaces removed - CSString rightStrip() const; + NLMISC_API CSString rightStrip() const; /// Making an upper case copy of a string - CSString toUpper() const; + NLMISC_API CSString toUpper() const; /// Making a lower case copy of a string - CSString toLower() const; + NLMISC_API CSString toLower() const; /// encapsulate string in quotes, adding escape characters as necessary - CSString quote( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' + NLMISC_API CSString quote(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; /// if a string is not already encapsulated in quotes then return quote() else return *this - CSString quoteIfNotQuoted( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' + NLMISC_API CSString quoteIfNotQuoted(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; /// if a string is not a single word and is not already encapsulated in quotes then return quote() else return *this - CSString quoteIfNotAtomic( bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' + NLMISC_API CSString quoteIfNotAtomic(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; /// strip delimiting quotes and clear through escape characters as necessary - CSString unquote(bool useSlashStringEscape=true, // treat '\' as escape char so "\"" == '"' + NLMISC_API CSString unquote(bool useSlashStringEscape = true, // treat '\' as escape char so "\"" == '"' bool useRepeatQuoteStringEscape=true // treat """" as '"' ) const; /// equivalent to if (isQuoted()) unquote() - CSString unquoteIfQuoted(bool useSlashStringEscape=true, + NLMISC_API CSString unquoteIfQuoted(bool useSlashStringEscape = true, bool useRepeatQuoteStringEscape=true ) const; /// encode special characters such as quotes, gt, lt, etc to xml encoding /// the isParameter paramter is true if the string is to be used in an XML parameter block - CSString encodeXML(bool isParameter=false) const; + NLMISC_API CSString encodeXML(bool isParameter = false) const; /// decode special characters such as quotes, gt, lt, etc from xml encoding - CSString decodeXML() const; + NLMISC_API CSString decodeXML() const; /// verifies whether a string contains sub-strings that correspond to xml special character codes - bool isEncodedXML() const; + NLMISC_API bool isEncodedXML() const; /// verifies whether a string contains any XML incompatible characters /// in this case the string can be converted to xml compatible format via encodeXML() /// the isParameter paramter is true if the string is to be used in an XML parameter block - bool isXMLCompatible(bool isParameter=false) const; + NLMISC_API bool isXMLCompatible(bool isParameter = false) const; /// Replacing all occurences of one string with another - CSString replace(const char *toFind,const char *replacement) const; + NLMISC_API CSString replace(const char *toFind, const char *replacement) const; /// Find index at which a sub-string starts (case not sensitive) - if sub-string not found then returns string::npos - std::string::size_type find(const char *toFind, std::string::size_type startLocation=0) const; + NLMISC_API std::string::size_type find(const char *toFind, std::string::size_type startLocation = 0) const; /// Find index at which a sub-string starts (case NOT sensitive) - if sub-string not found then returns string::npos - std::string::size_type findNS(const char *toFind, std::string::size_type startLocation=0) const; + NLMISC_API std::string::size_type findNS(const char *toFind, std::string::size_type startLocation = 0) const; /// Return true if this contains given sub string - bool contains(const char *toFind) const; + NLMISC_API bool contains(const char *toFind) const; /// Return true if this contains given sub string - bool contains(int character) const; + NLMISC_API bool contains(int character) const; /// Handy atoi routines... - int atoi() const; - sint32 atosi() const; - uint32 atoui() const; - sint64 atoi64() const; - sint64 atosi64() const; - uint64 atoui64() const; + NLMISC_API int atoi() const; + NLMISC_API sint32 atosi() const; + NLMISC_API uint32 atoui() const; + NLMISC_API sint64 atoi64() const; + NLMISC_API sint64 atosi64() const; + NLMISC_API uint64 atoui64() const; /// A handy atof routine... - double atof() const; + NLMISC_API double atof() const; /// assignment operator - CSString& operator=(const char *s); + NLMISC_API CSString &operator=(const char *s); /// assignment operator - CSString& operator=(const std::string &s); + NLMISC_API CSString &operator=(const std::string &s); /// assignment operator - CSString& operator=(char c); + NLMISC_API CSString &operator=(char c); /// assignment operator - CSString& operator=(int i); + NLMISC_API CSString &operator=(int i); /// assignment operator - CSString& operator=(uint32 u); + NLMISC_API CSString &operator=(uint32 u); /// assignment operator - CSString& operator=(double d); + NLMISC_API CSString &operator=(double d); /// Case insensitive string compare - bool operator==(const CSString &other) const; + NLMISC_API bool operator==(const CSString &other) const; /// Case insensitive string compare - bool operator==(const std::string &other) const; + NLMISC_API bool operator==(const std::string &other) const; /// Case insensitive string compare - bool operator==(const char* other) const; + NLMISC_API bool operator==(const char *other) const; /// Case insensitive string compare - bool operator!=(const CSString &other) const; + NLMISC_API bool operator!=(const CSString &other) const; /// Case insensitive string compare - bool operator!=(const std::string &other) const; + NLMISC_API bool operator!=(const std::string &other) const; /// Case insensitive string compare - bool operator!=(const char* other) const; + NLMISC_API bool operator!=(const char *other) const; /// Case insensitive string compare - bool operator<=(const CSString &other) const; + NLMISC_API bool operator<=(const CSString &other) const; /// Case insensitive string compare - bool operator<=(const std::string &other) const; + NLMISC_API bool operator<=(const std::string &other) const; /// Case insensitive string compare - bool operator<=(const char* other) const; + NLMISC_API bool operator<=(const char *other) const; /// Case insensitive string compare - bool operator>=(const CSString &other) const; + NLMISC_API bool operator>=(const CSString &other) const; /// Case insensitive string compare - bool operator>=(const std::string &other) const; + NLMISC_API bool operator>=(const std::string &other) const; /// Case insensitive string compare - bool operator>=(const char* other) const; + NLMISC_API bool operator>=(const char *other) const; /// Case insensitive string compare - bool operator>(const CSString &other) const; + NLMISC_API bool operator>(const CSString &other) const; /// Case insensitive string compare - bool operator>(const std::string &other) const; + NLMISC_API bool operator>(const std::string &other) const; /// Case insensitive string compare - bool operator>(const char* other) const; + NLMISC_API bool operator>(const char *other) const; /// Case insensitive string compare - bool operator<(const CSString &other) const; + NLMISC_API bool operator<(const CSString &other) const; /// Case insensitive string compare - bool operator<(const std::string &other) const; + NLMISC_API bool operator<(const std::string &other) const; /// Case insensitive string compare - bool operator<(const char* other) const; + NLMISC_API bool operator<(const char *other) const; //@{ //@name Easy concatenation operator to build strings @@ -466,22 +466,22 @@ public: //@} /// Case insensitive string compare (useful for use as map keys, see less below) - bool icompare(const std::string &other) const; + NLMISC_API bool icompare(const std::string &other) const; /// Serial - void serial( NLMISC::IStream& s ); + NLMISC_API void serial(NLMISC::IStream &s); /// Read a text file into a string - bool readFromFile(const CSString& fileName); + NLMISC_API bool readFromFile(const CSString &fileName); /// Write a string to a text file // returns true on success, false on failure - bool writeToFile(const CSString& fileName) const; + NLMISC_API bool writeToFile(const CSString &fileName) const; /// Write a string to a text file // if the file already exists and its content is identicall to our own then it is not overwritten // returns true on success (including the case where the file exists and is not overwritten), false on failure - bool writeToFileIfDifferent(const CSString& fileName) const; + NLMISC_API bool writeToFileIfDifferent(const CSString &fileName) const; }; diff --git a/code/nel/include/nel/misc/stop_watch.h b/code/nel/include/nel/misc/stop_watch.h index b519f4c82..543e70b84 100644 --- a/code/nel/include/nel/misc/stop_watch.h +++ b/code/nel/include/nel/misc/stop_watch.h @@ -37,7 +37,7 @@ typedef uint32 TMsDuration; * \author Nevrax France * \date 2001 */ -class CStopWatch +class NLMISC_API CStopWatch { public: diff --git a/code/nel/include/nel/misc/stream.h b/code/nel/include/nel/misc/stream.h index da9f2835e..99fbd1a5a 100644 --- a/code/nel/include/nel/misc/stream.h +++ b/code/nel/include/nel/misc/stream.h @@ -194,7 +194,7 @@ class IStreamable; * \author Nevrax France * \date 2000 */ -class IStream +class NLMISC_API IStream { public: /** diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index bb972a4eb..d4a304447 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -28,8 +28,8 @@ namespace NLMISC { // get a string and add \r before \n if necessary -std::string addSlashR (const std::string &str); -std::string removeSlashR (const std::string &str); +NLMISC_API std::string addSlashR(const std::string &str); +NLMISC_API std::string removeSlashR(const std::string &str); /** * \def MaxCStringSize @@ -81,7 +81,7 @@ _dest = _cstring * \param count Size of the buffer * \param format of the string, it must be the last argument before the \c '...' */ -sint smprintf( char *buffer, size_t count, const char *format, ... ); +NLMISC_API sint smprintf(char *buffer, size_t count, const char *format, ...); #ifdef NL_OS_WINDOWS @@ -246,7 +246,7 @@ inline bool fromString(const std::string &str, double &val) { bool ret = sscanf( // (str[0] == '1' || (str[0] & 0xD2) == 0x50) // - Kaetemi -bool fromString(const std::string &str, bool &val); +NLMISC_API bool fromString(const std::string &str, bool &val); inline bool fromString(const std::string &str, std::string &val) { val = str; return true; } @@ -260,30 +260,30 @@ inline bool fromString(const std::string &str, sint &val) { return sscanf(str.c_ // Convert local codepage to UTF-8 // On Windows, the local codepage is undetermined // On Linux, the local codepage is always UTF-8 (no-op) -std::string mbcsToUtf8(const char *str, size_t len = 0); -std::string mbcsToUtf8(const std::string &str); +NLMISC_API std::string mbcsToUtf8(const char *str, size_t len = 0); +NLMISC_API std::string mbcsToUtf8(const std::string &str); // Convert wide codepage to UTF-8 // On Windows, the wide codepage is UTF-16 // On Linux, the wide codepage is UTF-32 -std::string wideToUtf8(const wchar_t *str, size_t len = 0); -std::string wideToUtf8(const std::wstring &str); +NLMISC_API std::string wideToUtf8(const wchar_t *str, size_t len = 0); +NLMISC_API std::string wideToUtf8(const std::wstring &str); // Convert UTF-8 to wide character set -std::wstring utf8ToWide(const char *str, size_t len = 0); -std::wstring utf8ToWide(const std::string &str); +NLMISC_API std::wstring utf8ToWide(const char *str, size_t len = 0); +NLMISC_API std::wstring utf8ToWide(const std::string &str); // Convert UTF-8 to local multibyte character set -std::string utf8ToMbcs(const char *str, size_t len = 0); -std::string utf8ToMbcs(const std::string &str); +NLMISC_API std::string utf8ToMbcs(const char *str, size_t len = 0); +NLMISC_API std::string utf8ToMbcs(const std::string &str); // Convert wide to local multibyte character set -std::string wideToMbcs(const wchar_t *str, size_t len = 0); -std::string wideToMbcs(const std::wstring &str); +NLMISC_API std::string wideToMbcs(const wchar_t *str, size_t len = 0); +NLMISC_API std::string wideToMbcs(const std::wstring &str); // Convert local multibyte to wide character set -std::wstring mbcsToWide(const char *str, size_t len = 0); -std::wstring mbcsToWide(const std::string &str); +NLMISC_API std::wstring mbcsToWide(const char *str, size_t len = 0); +NLMISC_API std::wstring mbcsToWide(const std::string &str); inline const char *asCStr(const char *str) { return str; } inline const char *asCStr(const std::string &str) { return str.c_str(); } diff --git a/code/nel/include/nel/misc/string_mapper.h b/code/nel/include/nel/misc/string_mapper.h index aeaccf959..b95ca2697 100644 --- a/code/nel/include/nel/misc/string_mapper.h +++ b/code/nel/include/nel/misc/string_mapper.h @@ -60,7 +60,7 @@ struct CStringIdHashMapTraits * \author Nevrax France * \date 2003 */ -class CStringMapper +class NLMISC_API CStringMapper { class CCharComp { @@ -132,7 +132,7 @@ typedef uint TSStringId; * \author Nevrax France * \date November 2003 */ -class CStaticStringMapper +class NLMISC_API CStaticStringMapper { std::map _TempStringTable; diff --git a/code/nel/include/nel/misc/system_info.h b/code/nel/include/nel/misc/system_info.h index 747ff10d6..a2adca856 100644 --- a/code/nel/include/nel/misc/system_info.h +++ b/code/nel/include/nel/misc/system_info.h @@ -30,7 +30,7 @@ namespace NLMISC { * \author Nevrax France * \date 2000 */ -class CSystemInfo +class NLMISC_API CSystemInfo { public: diff --git a/code/nel/include/nel/misc/system_utils.h b/code/nel/include/nel/misc/system_utils.h index c51a5ab99..3e17c58c3 100644 --- a/code/nel/include/nel/misc/system_utils.h +++ b/code/nel/include/nel/misc/system_utils.h @@ -28,7 +28,7 @@ namespace NLMISC * \author Kervala * \date 2010 */ -class CSystemUtils +class NLMISC_API CSystemUtils { static nlWindow s_window; public: diff --git a/code/nel/include/nel/misc/task_manager.h b/code/nel/include/nel/misc/task_manager.h index 15b3eef0b..b0044a9a2 100644 --- a/code/nel/include/nel/misc/task_manager.h +++ b/code/nel/include/nel/misc/task_manager.h @@ -44,7 +44,7 @@ public: * \author Nevrax France * \date 2000 */ -class CTaskManager : public IRunnable +class NLMISC_API CTaskManager : public IRunnable { public: diff --git a/code/nel/include/nel/misc/tds.h b/code/nel/include/nel/misc/tds.h index db5fa2393..179eae6f9 100644 --- a/code/nel/include/nel/misc/tds.h +++ b/code/nel/include/nel/misc/tds.h @@ -34,7 +34,7 @@ namespace NLMISC * \author Nevrax France * \date 2002 */ -class CTDS +class NLMISC_API CTDS { public: diff --git a/code/nel/include/nel/misc/time_nl.h b/code/nel/include/nel/misc/time_nl.h index e7deaae24..065c10813 100644 --- a/code/nel/include/nel/misc/time_nl.h +++ b/code/nel/include/nel/misc/time_nl.h @@ -45,7 +45,7 @@ typedef sint64 TTicks; * \author Nevrax France * \date 2000-2005 */ -class CTime +class NLMISC_API CTime { public: struct CTimerInfo diff --git a/code/nel/include/nel/misc/triangle.h b/code/nel/include/nel/misc/triangle.h index 312e1a77f..d88fdf4df 100644 --- a/code/nel/include/nel/misc/triangle.h +++ b/code/nel/include/nel/misc/triangle.h @@ -37,7 +37,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CTriangle +class NLMISC_API CTriangle { public: CVector V0,V1,V2; diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 353f50490..6947b3a91 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -536,6 +536,24 @@ typedef uint16 ucchar; #endif #endif +#ifdef WIN32 +#define NL_DECL_DLLEXP __declspec(dllexport) +#define NL_DECL_DLLIMP __declspec(dllimport) +#else +#define NL_DECL_DLLEXP +#define NL_DECL_DLLIMP +#endif + +#ifdef NL_DLLEXP +#ifdef NLMISC_DLLEXP +#define NLMISC_API NL_DECL_DLLEXP +#else +#define NLMISC_API NL_DECL_DLLIMP +#endif +#else +#define NLMISC_API +#endif + // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) #ifdef NL_COMP_VC # if (NL_COMP_VC_VERSION >= 100) diff --git a/code/nel/include/nel/misc/ucstring.h b/code/nel/include/nel/misc/ucstring.h index 605a14a78..ff04fb349 100644 --- a/code/nel/include/nel/misc/ucstring.h +++ b/code/nel/include/nel/misc/ucstring.h @@ -372,18 +372,18 @@ struct CUCStringHashMapTraits * \param a string or a char to transform to lower case */ -ucstring toLower (const ucstring &str); -void toLower (ucchar *str); -ucchar toLower (ucchar c); +NLMISC_API ucstring toLower(const ucstring &str); +NLMISC_API void toLower(ucchar *str); +NLMISC_API ucchar toLower(ucchar c); /** Convert an unicode string in upper case. * Characters with accent are converted in a uppercase character without accent * \param a string or a char to transform to upper case */ -ucstring toUpper (const ucstring &str); -void toUpper (ucchar *str); -ucchar toUpper (ucchar c); +NLMISC_API ucstring toUpper(const ucstring &str); +NLMISC_API void toUpper(ucchar *str); +NLMISC_API ucchar toUpper(ucchar c); }; diff --git a/code/nel/include/nel/misc/variable.h b/code/nel/include/nel/misc/variable.h index 439165127..2f440959e 100644 --- a/code/nel/include/nel/misc/variable.h +++ b/code/nel/include/nel/misc/variable.h @@ -133,7 +133,7 @@ void __name##Class::ptr(__type *pointer, bool get, bool human) const // // -class IVariable : public ICommand +class NLMISC_API IVariable : public ICommand { friend class CCommandRegistry; public: diff --git a/code/nel/include/nel/misc/vector.h b/code/nel/include/nel/misc/vector.h index bbf7001b7..550fa0bab 100644 --- a/code/nel/include/nel/misc/vector.h +++ b/code/nel/include/nel/misc/vector.h @@ -36,7 +36,7 @@ class IStream; * \author Nevrax France * \date 2000 */ -class CVector +class NLMISC_API CVector { public: // Attributes. float x,y,z; diff --git a/code/nel/include/nel/misc/vector_2f.h b/code/nel/include/nel/misc/vector_2f.h index 5fc1c8cd6..cd48b6841 100644 --- a/code/nel/include/nel/misc/vector_2f.h +++ b/code/nel/include/nel/misc/vector_2f.h @@ -35,7 +35,7 @@ namespace NLMISC * \author Nevrax France * \date 2001 */ -class CVector2f +class NLMISC_API CVector2f { public: diff --git a/code/nel/include/nel/misc/vectord.h b/code/nel/include/nel/misc/vectord.h index ec9f5c60e..f3b98ff4a 100644 --- a/code/nel/include/nel/misc/vectord.h +++ b/code/nel/include/nel/misc/vectord.h @@ -32,7 +32,7 @@ namespace NLMISC * \author Nevrax France * \date 2000 */ -class CVectorD +class NLMISC_API CVectorD { public: // Attributes. double x,y,z; diff --git a/code/nel/include/nel/misc/win32_util.h b/code/nel/include/nel/misc/win32_util.h index d040458c1..c6365a8f5 100644 --- a/code/nel/include/nel/misc/win32_util.h +++ b/code/nel/include/nel/misc/win32_util.h @@ -27,7 +27,7 @@ namespace NLMISC { - struct CWin32Util + struct NLMISC_API CWin32Util { /** replace all occurence of 'uiIdentifier' in a window with their localized versions * (from CI18N) diff --git a/code/nel/include/nel/misc/win_displayer.h b/code/nel/include/nel/misc/win_displayer.h index 7eca48351..5f84ffc0d 100644 --- a/code/nel/include/nel/misc/win_displayer.h +++ b/code/nel/include/nel/misc/win_displayer.h @@ -53,7 +53,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class CWinDisplayer : public NLMISC::CWindowDisplayer +class NLMISC_API CWinDisplayer : public NLMISC::CWindowDisplayer { public: diff --git a/code/nel/include/nel/misc/win_event_emitter.h b/code/nel/include/nel/misc/win_event_emitter.h index 1b361485f..bdf65a570 100644 --- a/code/nel/include/nel/misc/win_event_emitter.h +++ b/code/nel/include/nel/misc/win_event_emitter.h @@ -30,7 +30,7 @@ namespace NLMISC { * CWinEventEmitter * CEventEmitter Windows implementation */ -class CWinEventEmitter : public IEventEmitter +class NLMISC_API CWinEventEmitter : public IEventEmitter { public: CWinEventEmitter () : _MouseEventsEnabled(true), _KeyboardEventsEnabled(true), _IMEEventsEnabled(true) diff --git a/code/nel/include/nel/misc/win_thread.h b/code/nel/include/nel/misc/win_thread.h index 1ba122126..02f22ef27 100644 --- a/code/nel/include/nel/misc/win_thread.h +++ b/code/nel/include/nel/misc/win_thread.h @@ -31,7 +31,7 @@ namespace NLMISC { * \author Nevrax France * \date 2000 */ -class CWinThread : public IThread +class NLMISC_API CWinThread : public IThread { public: @@ -91,7 +91,7 @@ private: * \author Nevrax France * \date 2001, 2007 */ -class CWinProcess : public IProcess +class NLMISC_API CWinProcess : public IProcess { public: diff --git a/code/nel/include/nel/misc/window_displayer.h b/code/nel/include/nel/misc/window_displayer.h index 4fc86c2b0..15533b6bd 100644 --- a/code/nel/include/nel/misc/window_displayer.h +++ b/code/nel/include/nel/misc/window_displayer.h @@ -35,7 +35,7 @@ namespace NLMISC { * \author Nevrax France * \date 2001 */ -class CWindowDisplayer : public NLMISC::IDisplayer +class NLMISC_API CWindowDisplayer : public NLMISC::IDisplayer { public: diff --git a/code/nel/include/nel/misc/words_dictionary.h b/code/nel/include/nel/misc/words_dictionary.h index ad7802aeb..adfea630e 100644 --- a/code/nel/include/nel/misc/words_dictionary.h +++ b/code/nel/include/nel/misc/words_dictionary.h @@ -32,7 +32,7 @@ namespace NLMISC { * \author Nevrax France * \date 2003 */ -class CWordsDictionary +class NLMISC_API CWordsDictionary { NL_INSTANCE_COUNTER_DECL(CWordsDictionary); public: diff --git a/code/nel/include/nel/misc/xml_auto_ptr.h b/code/nel/include/nel/misc/xml_auto_ptr.h index 83f6b1ad8..ba3210a12 100644 --- a/code/nel/include/nel/misc/xml_auto_ptr.h +++ b/code/nel/include/nel/misc/xml_auto_ptr.h @@ -26,7 +26,7 @@ /** Simple auto pointer for xml pointers */ -class CXMLAutoPtr +class NLMISC_API CXMLAutoPtr { public: CXMLAutoPtr(const char *value = NULL) : _Value(value) {} diff --git a/code/nel/include/nel/misc/xml_pack.h b/code/nel/include/nel/misc/xml_pack.h index 5dc2f5b2f..e323d106a 100644 --- a/code/nel/include/nel/misc/xml_pack.h +++ b/code/nel/include/nel/misc/xml_pack.h @@ -41,7 +41,7 @@ namespace NLMISC * the loadForm function of george) that are a binary extraction of * the content of the xml files. */ - class CXMLPack +class NLMISC_API CXMLPack { NLMISC_SAFE_SINGLETON_DECL(CXMLPack); diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index ec0dcd357..06c8230d8 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -171,7 +171,7 @@ SOURCE_GROUP("i18n" FILES ${NLMISC_I18N}) SOURCE_GROUP("crypt" FILES ${NLMISC_CRYPT}) SOURCE_GROUP("string" FILES ${NLMISC_STRING}) -NL_TARGET_LIB(nelmisc ${HEADERS} ${SRC}) +NL_TARGET_LIB2(nelmisc ${HEADERS} ${SRC}) IF(WITH_GTK) IF(GTK2_FOUND) @@ -219,6 +219,10 @@ NL_ADD_LIB_SUFFIX(nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WIN32 AND NOT WITH_STATIC2) + ADD_DEFINITIONS(-DNLMISC_DLLEXP) +ENDIF() + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp) ENDIF()