#include <windows.h>\r
#include <commctrl.h>\r
#include <richedit.h>\r
+#ifndef USE_CMAKE_CONFIG_H\r
#define USE_CMAKE_CONFIG_H\r
+#endif\r
#include "config.h"\r
#undef USE_CMAKE_CONFIG_H\r
\r
if(MSVC)
# Visual Studio
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D WIN32_LEAN_AND_MEAN /MP")
# EHa enables SEH exceptions (used for catching segfaults)
- set(CMAKE_CXX_FLAGS_RELEASE "/EHa /Ox /GL /FD /MT /GS- /Zi /arch:SSE /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
+ set(CMAKE_CXX_FLAGS_RELEASE "/EHa /Ox /GL /FD /MT /GS- /Zi /fp:fast /D NDEBUG /D _HAS_ITERATOR_DEBUGGING=0 /TP")
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:SSE")
+ endif()
#set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /NODEFAULTLIB:\"libcmtd.lib\" /NODEFAULTLIB:\"libcmt.lib\"")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF")
if(MINGW)
set(OTHER_FLAGS "${OTHER_FLAGS} -mthreads -fexceptions")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32_LEAN_AND_MEAN")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -Wall -pipe -funroll-loops")
#include "database-postgresql.h"
#ifdef _WIN32
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
// Without this some of the network functions are not found on mingw
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#include "gettime.h"
#include "log.h"
-#if (defined(WIN32) || defined(_WIN32_WCE))
- #define WIN32_LEAN_AND_MEAN
+#ifdef _WIN32
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
data->fillBlockDataBegin(q->p);
- int t_now = time(0);
+ std::time_t t_now = std::time(0);
// Collect data for 3*3*3 blocks from cache
v3s16 dp;
#ifndef MESH_GENERATOR_THREAD_HEADER
#define MESH_GENERATOR_THREAD_HEADER
+#include <ctime>
#include <mutex>
#include "mapblock_mesh.h"
#include "threading/mutex_auto_lock.h"
v3s16 p = v3s16(-1337, -1337, -1337);
MapNode *data = nullptr; // A copy of the MapBlock's data member
int refcount_from_queue = 0;
- int last_used_timestamp = std::time(0);
+ std::time_t last_used_timestamp = std::time(0);
CachedMapBlockData() {}
~CachedMapBlockData();
float x, float y, float z);
float cos_lookup[16] = {
- 1.0, 0.9238, 0.7071, 0.3826, 0, -0.3826, -0.7071, -0.9238,
- 1.0, -0.9238, -0.7071, -0.3826, 0, 0.3826, 0.7071, 0.9238
+ 1.0f, 0.9238f, 0.7071f, 0.3826f, .0f, -0.3826f, -0.7071f, -0.9238f,
+ 1.0f, -0.9238f, -0.7071f, -0.3826f, .0f, 0.3826f, 0.7071f, 0.9238f
};
FlagDesc flagdesc_noiseparams[] = {
#include "log.h"
#ifdef _WIN32
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
// Without this some of the network functions are not found on mingw
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#define SOCKET_HEADER
#ifdef _WIN32
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
return false;
-#elif USE_WIN_THREADS
+#elif _MSC_VER
return SetThreadAffinityMask(getThreadHandle(), 1 << proc_number);
+#elif __MINGW32__
+
+ return SetThreadAffinityMask(pthread_gethandle(getThreadHandle()), 1 << proc_number);
+
#elif __FreeBSD_version >= 702106 || defined(__linux__)
cpu_set_t cpuset;
bool Thread::setPriority(int prio)
{
-#if USE_WIN_THREADS
+#ifdef _MSC_VER
return SetThreadPriority(getThreadHandle(), prio);
+#elif __MINGW32__
+
+ return SetThreadPriority(pthread_gethandle(getThreadHandle()), prio);
+
#else
struct sched_param sparam;