#pragma once #if defined(_M_X64) || defined(__x86_64__) # define SPRAWL_64_BIT 1 # define SPRAWL_32_BIT 0 #else # define SPRAWL_64_BIT 0 # define SPRAWL_32_BIT 1 #endif #if defined(__GNUC__) || defined(__INTEL_COMPILER) # define SPRAWL_LIKELY(x) (__builtin_expect(!!(x), 1)) # define SPRAWL_UNLIKELY(x) (__builtin_expect(!!(x), 0)) #else # define SPRAWL_LIKELY(x) (x) # define SPRAWL_UNLIKELY(x) (x) #endif #if defined(__GNUC__) || defined(__INTEL_COMPILER) # define SPRAWL_MEMCMP __builtin_memcmp # ifndef SPRAWL_MULTITHREADED # ifdef _REENTRANT # define SPRAWL_MULTITHREADED 1 # else # define SPRAWL_MULTITHREADED 0 # endif # endif # define SPRAWL_FORCEINLINE inline __attribute__((always_inline)) # define SPRAWL_CONSTEXPR constexpr #else # define SPRAWL_MEMCMP memcmp # ifndef SPRAWL_MULTITHREADED # ifdef _MT # define SPRAWL_MULTITHREADED 1 # else # define SPRAWL_MULTITHREADED 0 # endif # endif # define SPRAWL_FORCEINLINE inline __forceinline # define SPRAWL_CONSTEXPR const #endif #define SPRAWL_CONCAT_2(left, right) left ## right #define SPRAWL_CONCAT(left, right) SPRAWL_CONCAT_2(left, right) #if defined(_MSC_VER) #include <BaseTsd.h> typedef SSIZE_T ssize_t; #endif #if defined(_WIN32) #define SPRAWL_I64FMT "ll" #elif defined(__APPLE__) #define SPRAWL_I64FMT "ll" #else #define SPRAWL_I64FMT "l" #endif //Detecting debug settings works as follows: // 1) If __OPTIMIZE__ is defined, DEBUG is 0 regardless of system // 2) If _DEBUG is defined, DEBUG is 1 regardless of system // 3) If neither of those is defined, DEBUG is 0 for Windows (which makes a define for when something IS debug) // or 1 otherwise (where a define is made when something IS NOT debug) #if defined(__OPTIMIZE__) # define SPRAWL_DEBUG 0 #elif defined(_DEBUG) # define SPRAWL_DEBUG 1 #else # ifdef _WIN32 # define SPRAWL_DEBUG 0 # else # define SPRAWL_DEBUG 1 # endif #endif
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 18645 | brandon_m_bare | Integrated latest version of libsprawl. | ||
#1 | 15089 | brandon_m_bare | First integration of sprawl. | ||
//guest/ShadauxCat/Sprawl/Mainline/common/compat.hpp | |||||
#3 | 14121 | ShadauxCat |
-Fixed msvc compile errors (msvc sucks at decltype, btw...) -Fixed BitVector and BitSet being broken on msvc due to 1L being 32-bit rather than 64-bit -Fixed Deque being broken on 32-bit systems due to an errant int64_t -Changed types of deque indexes from size_t to ssize_t; since they have to be signed for a moment to handle circling the buffer, the sign bit is lost for capacity anyway, and using signed indexes means... -Deque and Vector now support negative indexing a la python list #review-14122 |
||
#2 | 13650 | ShadauxCat |
- Windows implementations of thread and time libraries - Added coroutines - Added some more unit tests, fixed some unit tests in windows environments - Fixed an issue where multi threading was not properly detected on Linux - Fixed the makefiles to build with threading by default on linux - Changed the pool allocator to use thread-local pools instead of locking mutexes - Fixed output of sprawl::string in the StringBuilder library to take length into account - Added string builder options for StringLiteral - Added thread local implementation #review |
||
#1 | 11496 | ShadauxCat | Initial checkin: Current states for csbuild and libSprawl |