Fixed per-class thread safety
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
#ifndef NAZARA_BYTEARRAY_HPP
|
||||
#define NAZARA_BYTEARRAY_HPP
|
||||
|
||||
#define NAZARA_BYTEARRAY
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Hashable.hpp>
|
||||
|
||||
#define NAZARA_CLASS_BYTEARRAY
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NzAbstractHash;
|
||||
@@ -119,6 +119,6 @@ namespace std
|
||||
NAZARA_API void swap(NzByteArray& lhs, NzByteArray& rhs);
|
||||
}
|
||||
|
||||
#undef NAZARA_BYTEARRAY
|
||||
#undef NAZARA_CLASS_BYTEARRAY
|
||||
|
||||
#endif // NAZARA_BYTEARRAY_HPP
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#ifndef NAZARA_CLOCK_HPP
|
||||
#define NAZARA_CLOCK_HPP
|
||||
|
||||
#define NAZARA_CLOCK
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
#define NAZARA_CLASS_CLOCK
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NAZARA_API NzClock
|
||||
@@ -40,6 +40,6 @@ typedef nzUInt64 (*NzClockFunction)();
|
||||
extern NAZARA_API NzClockFunction NzGetMicroseconds;
|
||||
extern NAZARA_API NzClockFunction NzGetMilliseconds;
|
||||
|
||||
#undef NAZARA_CLOCK
|
||||
#undef NAZARA_CLASS_CLOCK
|
||||
|
||||
#endif // NAZARA_CLOCK_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||
#define NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||
|
||||
#define NAZARA_DEBUG_MEMORYLEAKTRACKER
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
@@ -34,6 +32,4 @@ NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int
|
||||
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) throw();
|
||||
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) throw();
|
||||
|
||||
#undef NAZARA_DEBUG_MEMORYLEAKTRACKER
|
||||
|
||||
#endif // NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||
|
||||
@@ -7,11 +7,8 @@
|
||||
#ifndef NAZARA_DIRECTORY_HPP
|
||||
#define NAZARA_DIRECTORY_HPP
|
||||
|
||||
#define NAZARA_DIRECTORY
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#define NAZARA_DIRECTORY_SEPARATOR '\\'
|
||||
@@ -22,6 +19,9 @@
|
||||
#define NAZARA_DIRECTORY_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
#define NAZARA_CLASS_DIRECTORY
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NzDirectoryImpl;
|
||||
|
||||
class NAZARA_API NzDirectory
|
||||
@@ -59,6 +59,6 @@ class NAZARA_API NzDirectory
|
||||
NzDirectoryImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_DIRECTORY
|
||||
#undef NAZARA_CLASS_DIRECTORY
|
||||
|
||||
#endif // NAZARA_DIRECTORY_HPP
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#ifndef NAZARA_DYNLIB_HPP
|
||||
#define NAZARA_DYNLIB_HPP
|
||||
|
||||
#define NAZARA_DYNLIB
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
#define NAZARA_DYNLIB
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NzDynLibImpl;
|
||||
typedef int (*NzDynLibFunc)(); // Type "générique" de pointeur sur fonction
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_ENDIANNESS_HPP
|
||||
#define NAZARA_ENDIANNESS_HPP
|
||||
|
||||
#define NAZARA_ENDIANNESS
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
#if defined(NAZARA_ENDIANNESS_BIGENDIAN)
|
||||
@@ -45,6 +43,4 @@ inline nzEndianness NzGetPlatformEndianness();
|
||||
|
||||
#include <Nazara/Core/Endianness.inl>
|
||||
|
||||
#undef NAZARA_ENDIANNESS
|
||||
|
||||
#endif // NAZARA_ENDIANNESS_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_ERROR_HPP
|
||||
#define NAZARA_ERROR_HPP
|
||||
|
||||
#define NAZARA_ERROR
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
|
||||
@@ -34,6 +32,4 @@ NAZARA_API void NzError(nzErrorType type, const NzString& error, unsigned int li
|
||||
NAZARA_API unsigned int NzGetLastSystemErrorCode();
|
||||
NAZARA_API NzString NzGetLastSystemError(unsigned int code = NzGetLastSystemErrorCode());
|
||||
|
||||
#undef NAZARA_ERROR
|
||||
|
||||
#endif // NAZARA_ERROR_HPP
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
#ifndef NAZARA_FILE_HPP
|
||||
#define NAZARA_FILE_HPP
|
||||
|
||||
#define NAZARA_FILE
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Directory.hpp>
|
||||
#include <Nazara/Core/Endianness.hpp>
|
||||
#include <Nazara/Core/Hashable.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
#define NAZARA_CLASS_FILE
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NzFileImpl;
|
||||
|
||||
class NAZARA_API NzFile : public NzHashable, NzNonCopyable
|
||||
@@ -115,6 +115,6 @@ class NAZARA_API NzFile : public NzHashable, NzNonCopyable
|
||||
unsigned int m_openMode;
|
||||
};
|
||||
|
||||
#undef NAZARA_FILE
|
||||
#undef NAZARA_CLASS_FILE
|
||||
|
||||
#endif // NAZARA_FILE_HPP
|
||||
|
||||
@@ -7,12 +7,8 @@
|
||||
#ifndef NAZARA_FORMAT_HPP
|
||||
#define NAZARA_FORMAT_HPP
|
||||
|
||||
#define NAZARA_FORMAT
|
||||
|
||||
#include <Nazara/Core/String.hpp>
|
||||
|
||||
template<typename... Args> NzString NzFormat(const NzString& str, Args... args);
|
||||
|
||||
#undef NAZARA_FORMAT
|
||||
|
||||
#endif // NAZARA_FORMAT_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASH_HPP
|
||||
#define NAZARA_HASH_HPP
|
||||
|
||||
#define NAZARA_HASH
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Hashable.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
@@ -28,6 +26,4 @@ class NAZARA_API NzHash : NzNonCopyable
|
||||
NzHashImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASH
|
||||
|
||||
#endif // NAZARA_HASH_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASH_CRC32_HPP
|
||||
#define NAZARA_HASH_CRC32_HPP
|
||||
|
||||
#define NAZARA_HASH_CRC32
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
#include <Nazara/Core/HashImpl.hpp>
|
||||
@@ -32,6 +30,4 @@ class NAZARA_API NzHashCRC32 : public NzHashImpl
|
||||
NzHashCRC32_state* m_state;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASH_CRC32
|
||||
|
||||
#endif // NAZARA_HASH_CRC32_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASH_FLETCHER16_HPP
|
||||
#define NAZARA_HASH_FLETCHER16_HPP
|
||||
|
||||
#define NAZARA_HASH_FLETCHER16
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
#include <Nazara/Core/HashImpl.hpp>
|
||||
@@ -33,6 +31,4 @@ class NAZARA_API NzHashFletcher16 : public NzHashImpl
|
||||
NzHashFletcher16_state* m_state;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASH_FLETCHER16
|
||||
|
||||
#endif // NAZARA_HASH_FLETCHER16_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASH_MD5_HPP
|
||||
#define NAZARA_HASH_MD5_HPP
|
||||
|
||||
#define NAZARA_HASH_MD5
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
#include <Nazara/Core/HashImpl.hpp>
|
||||
@@ -32,6 +30,4 @@ class NAZARA_API NzHashMD5 : public NzHashImpl
|
||||
NzHashMD5_state* m_state;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASH_MD5
|
||||
|
||||
#endif // NAZARA_HASH_MD5_HPP
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#ifndef NAZARA_HASH_WHIRLPOOL_HPP
|
||||
#define NAZARA_HASH_WHIRLPOOL_HPP
|
||||
|
||||
#define NAZARA_HASH_WHIRLPOOL
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/HashDigest.hpp>
|
||||
#include <Nazara/Core/HashImpl.hpp>
|
||||
@@ -30,6 +28,4 @@ class NAZARA_API NzHashWhirlpool : public NzHashImpl
|
||||
NzHashWhirlpool_state* m_state;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASH_WHIRLPOOL
|
||||
|
||||
#endif // NAZARA_HASH_WHIRLPOOL_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASHDIGEST_HPP
|
||||
#define NAZARA_HASHDIGEST_HPP
|
||||
|
||||
#define NAZARA_HASHDIGEST
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <ostream>
|
||||
@@ -50,6 +48,4 @@ class NAZARA_API NzHashDigest
|
||||
unsigned short m_digestLength;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASHDIGEST
|
||||
|
||||
#endif // NAZARA_HASHDIGEST_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_HASHIMPL_HPP
|
||||
#define NAZARA_HASHIMPL_HPP
|
||||
|
||||
#define NAZARA_HASHIMPL
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
@@ -25,6 +23,4 @@ class NAZARA_API NzHashImpl : NzNonCopyable
|
||||
virtual NzHashDigest End() = 0;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASHIMPL
|
||||
|
||||
#endif // NAZARA_HASHIMPL_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_LOCK_HPP
|
||||
#define NAZARA_LOCK_HPP
|
||||
|
||||
#define NAZARA_LOCK
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
class NzMutex;
|
||||
@@ -23,6 +21,4 @@ class NAZARA_API NzLock
|
||||
NzMutex& m_mutex;
|
||||
};
|
||||
|
||||
#undef NAZARA_LOCK
|
||||
|
||||
#endif // NAZARA_LOCK_HPP
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#ifndef NAZARA_LOG_HPP
|
||||
#define NAZARA_LOG_HPP
|
||||
|
||||
#define NAZARA_LOG
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
#define NAZARA_CLASS_LOG
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
#define NazaraLog NzLog::Instance()
|
||||
|
||||
class NzFile;
|
||||
@@ -50,6 +50,6 @@ class NAZARA_API NzLog : NzNonCopyable
|
||||
bool m_writeTime;
|
||||
};
|
||||
|
||||
#undef NAZARA_LOGGER
|
||||
#undef NAZARA_CLASS_LOG
|
||||
|
||||
#endif // NAZARA_LOGGER_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_MUTEX_HPP
|
||||
#define NAZARA_MUTEX_HPP
|
||||
|
||||
#define NAZARA_MUTEX
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
@@ -31,6 +29,4 @@ class NAZARA_API NzMutex : NzNonCopyable
|
||||
NzMutexImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_MUTEX
|
||||
|
||||
#endif // NAZARA_MUTEX_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_SEMAPHORE_HPP
|
||||
#define NAZARA_SEMAPHORE_HPP
|
||||
|
||||
#define NAZARA_SEMAPHORE
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
|
||||
@@ -29,6 +27,4 @@ class NAZARA_API NzSemaphore : NzNonCopyable
|
||||
NzSemaphoreImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_SEMAPHORE
|
||||
|
||||
#endif // NAZARA_SEMAPHORE_HPP
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
#ifndef NAZARA_STRING_HPP
|
||||
#define NAZARA_STRING_HPP
|
||||
|
||||
#define NAZARA_STRING
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Hashable.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define NAZARA_CLASS_STRING
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NzAbstractHash;
|
||||
class NzHashDigest;
|
||||
|
||||
@@ -317,7 +317,6 @@ namespace std
|
||||
NAZARA_API void swap(NzString& lhs, NzString& rhs);
|
||||
}
|
||||
|
||||
#undef NAZARA_STRING
|
||||
#undef NAZARA_CLASS_STRING
|
||||
|
||||
#endif // NAZARA_STRING_HPP
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#ifndef NAZARA_STRINGSTREAM_HPP
|
||||
#define NAZARA_STRINGSTREAM_HPP
|
||||
|
||||
#define NAZARA_STRINGSTREAM
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define NAZARA_CLASS_STRINGSTREAM
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
class NAZARA_API NzStringStream
|
||||
{
|
||||
public:
|
||||
@@ -51,6 +51,6 @@ class NAZARA_API NzStringStream
|
||||
unsigned int m_bufferSize;
|
||||
};
|
||||
|
||||
#undef NAZARA_STRINGSTREAM
|
||||
#undef NAZARA_CLASS_STRINGSTREAM
|
||||
|
||||
#endif // NAZARA_STRINGSTREAM_HPP
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#ifndef NAZARA_THREAD_HPP
|
||||
#define NAZARA_THREAD_HPP
|
||||
|
||||
#define NAZARA_THREAD
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Utility/Functor.hpp>
|
||||
#include <Nazara/Utility/NonCopyable.hpp>
|
||||
@@ -64,6 +62,4 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||
|
||||
#include <Nazara/Core/Thread.inl>
|
||||
|
||||
#undef NAZARA_THREAD
|
||||
|
||||
#endif // NAZARA_THREAD_HPP
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_THREADCONDITION_HPP
|
||||
#define NAZARA_THREADCONDITION_HPP
|
||||
|
||||
#define NAZARA_THREADCONDITION
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
class NzMutex;
|
||||
@@ -30,6 +28,4 @@ class NAZARA_API NzThreadCondition
|
||||
NzThreadConditionImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_THREADCONDITION
|
||||
|
||||
#endif // NAZARA_THREADCONDITION_HPP
|
||||
|
||||
@@ -15,15 +15,14 @@
|
||||
#undef NazaraNamedLock
|
||||
|
||||
#if NAZARA_CORE_THREADSAFE && (\
|
||||
(NAZARA_THREADSAFETY_BYTEARRAY && (defined(NAZARA_BYTEARRAY) || defined(NAZARA_BYTEARRAY_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_CLOCK && (defined(NAZARA_CLOCK) || defined(NAZARA_CLOCK_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_DIRECTORY && (defined(NAZARA_DIRECTORY) || defined(NAZARA_DIRECTORY_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_DYNLIB && (defined(NAZARA_DYNLIB) || defined(NAZARA_DYNLIB_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_FILE && (defined(NAZARA_FILE) || defined(NAZARA_FILE_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_HASHDIGEST && (defined(NAZARA_HASHDIGEST) || defined(NAZARA_HASHDIGEST_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_LOG && (defined(NAZARA_LOG) || defined(NAZARA_LOG_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_STRING && (defined(NAZARA_STRING) || defined(NAZARA_STRING_CPP))) || \
|
||||
(NAZARA_THREADSAFETY_STRINGSTREAM && (defined(NAZARA_STRINGSTREAM) || defined(NAZARA_STRINGSTREAM_CPP))))
|
||||
(NAZARA_THREADSAFETY_BYTEARRAY && defined(NAZARA_CLASS_BYTEARRAY)) || \
|
||||
(NAZARA_THREADSAFETY_CLOCK && defined(NAZARA_CLASS_CLOCK)) || \
|
||||
(NAZARA_THREADSAFETY_DIRECTORY && defined(NAZARA_CLASS_DIRECTORY)) || \
|
||||
(NAZARA_THREADSAFETY_DYNLIB && defined(NAZARA_CLASS_DYNLIB)) || \
|
||||
(NAZARA_THREADSAFETY_FILE && defined(NAZARA_CLASS_FILE)) || \
|
||||
(NAZARA_THREADSAFETY_LOG && defined(NAZARA_CLASS_LOG)) || \
|
||||
(NAZARA_THREADSAFETY_STRING && defined(NAZARA_CLASS_STRING)) || \
|
||||
(NAZARA_THREADSAFETY_STRINGSTREAM && defined(NAZARA_CLASS_STRINGSTREAM)))
|
||||
|
||||
#include <Nazara/Core/Lock.hpp>
|
||||
#include <Nazara/Core/Mutex.hpp>
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#ifndef NAZARA_UNICODE_HPP
|
||||
#define NAZARA_UNICODE_HPP
|
||||
|
||||
#define NAZARA_UNICODE
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
namespace NzUnicode
|
||||
@@ -105,6 +103,4 @@ namespace NzUnicode
|
||||
char32_t GetUppercase(char32_t character);
|
||||
}
|
||||
|
||||
#undef NAZARA_UNICODE
|
||||
|
||||
#endif // NAZARA_UNICODE_HPP
|
||||
|
||||
Reference in New Issue
Block a user