*/
#include "tessellator.hpp"
-#if defined(__MINGW32__) || defined(__MINGW64__)
-#include <cmath>
-#elif defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#include <math.h> // ceil
#else
#include <cmath>
if (iShift >= 0)
{
// assert( iShift < 32 );
-#if defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#pragma warning( suppress : 4293 )
#endif
_fxpMaxPosValueFloat -= INT32( 1 ) << iShift;
if (iShift >= 0)
{
// assert( iShift < 32 );
-#if defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#pragma warning( suppress : 4293 )
#endif
_fxpMaxPosValueFloat -= INT32( 1 ) << iShift;
version : '0.0.0',
soversion : host_machine.system() == 'windows' ? '' : '0',
install : true,
+ name_prefix : host_machine.system() == 'windows' ? '' : 'lib',
)
else
swr_arch_libs += static_library(
version : '0.0.0',
soversion : host_machine.system() == 'windows' ? '' : '0',
install : true,
+ name_prefix : host_machine.system() == 'windows' ? '' : 'lib',
)
else
swr_arch_libs += static_library(
version : '0.0.0',
soversion : host_machine.system() == 'windows' ? '' : '0',
install : true,
+ name_prefix : host_machine.system() == 'windows' ? '' : 'lib',
)
else
swr_arch_libs += static_library(
version : '0.0.0',
soversion : host_machine.system() == 'windows' ? '' : '0',
install : true,
+ name_prefix : host_machine.system() == 'windows' ? '' : 'lib',
)
else
swr_arch_libs += static_library(
* @brief Implementation for archrast.
*
******************************************************************************/
+#include <sys/stat.h>
+
#include <atomic>
#include <map>
#include <pthread.h>
#endif // Linux
-#if defined(_WIN32)
+#if defined(_MSC_VER)
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
#pragma pack(push, 8)
void SWR_API SetCurrentThreadName(const char* pThreadName)
{
-#if defined(_WIN32)
+#if defined(_MSC_VER)
// The SetThreadDescription API was brought in version 1607 of Windows 10.
typedef HRESULT(WINAPI * PFNSetThreadDescription)(HANDLE hThread, PCWSTR lpThreadDescription);
// The SetThreadDescription API works even if no debugger is attached.
#undef MemoryFence
#endif
+#if defined(_MSC_VER)
#define OSALIGN(RWORD, WIDTH) __declspec(align(WIDTH)) RWORD
+#elif defined(__GNUC__)
+#define OSALIGN(RWORD, WIDTH) RWORD __attribute__((aligned(WIDTH)))
+#endif
#if defined(_DEBUG)
// We compile Debug builds with inline function expansion enabled. This allows
#if SWR_ENABLE_ASSERTS || SWR_ENABLE_REL_ASSERTS
-#if defined(_WIN32)
+#if defined(_MSC_VER)
#pragma comment(lib, "user32.lib")
#endif // _WIN32
while (0) \
_SWR_WARN_RESTORE
-#if defined(_WIN32)
+#if defined(_MSC_VER)
#define SWR_ASSUME(e, ...) \
_SWR_MACRO_START __assume(e); \
_SWR_MACRO_END
*/
#include "tessellator.hpp"
-#if defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#include <math.h> // ceil
#else
#include <cmath>
if (iShift >= 0)
{
// assert( iShift < 32 );
-#if defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#pragma warning( suppress : 4293 )
#endif
_fxpMaxPosValueFloat -= INT32( 1 ) << iShift;
if (iShift >= 0)
{
// assert( iShift < 32 );
-#if defined(_WIN32) || defined(_WIN64)
+#if defined(_MSC_VER)
#pragma warning( suppress : 4293 )
#endif
_fxpMaxPosValueFloat -= INT32( 1 ) << iShift;
Core* pCore = nullptr;
- uint32_t numThreads = (uint32_t)_mm_popcount_sizeT(gmask.Mask);
-
while (BitScanForwardSizeT((unsigned long*)&threadId, gmask.Mask))
{
// clear mask
auto& numaNode = out_nodes[numaId];
numaNode.numaId = numaId;
- uint32_t coreId = 0;
-
if (nullptr == pCore)
{
numaNode.cores.push_back(Core());
template <bool IsFEThread, bool IsBEThread>
DWORD workerThreadInit(LPVOID pData)
{
-#if defined(_WIN32)
+#if defined(_MSC_VER)
__try
#endif // _WIN32
{
return workerThreadMain<IsFEThread, IsBEThread>(pData);
}
-#if defined(_WIN32)
+#if defined(_MSC_VER)
__except (EXCEPTION_CONTINUE_SEARCH)
{
}
mFetchShaderTy = FunctionType::get(Type::getVoidTy(mContext), fsArgs, false);
-#if defined(_WIN32)
+#if defined(_MSC_VER)
// explicitly instantiate used symbols from potentially staticly linked libs
sys::DynamicLibrary::AddSymbol("exp2f", &exp2f);
sys::DynamicLibrary::AddSymbol("log2f", &log2f);
#pragma once
-#if defined(_WIN32)
+#if defined(_MSC_VER)
#pragma warning(disable : 4146 4244 4267 4800 4996)
#endif
******************************************************************************/
#pragma once
-#if defined(_WIN32)
+#if defined(_MSC_VER)
// disable "potential divide by 0"
#pragma warning(disable: 4723)
#endif