mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Drop XInitThreads workaround
GTK used by wxWidgets on Unix calls it when creating an X11 window as does SDL. As such this is no longer needed and we avoid a direct dependency on X11. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -122,14 +122,6 @@
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
|
||||
#if !(OS_WIN || OS_MACOSX || OS_ANDROID) // assume all other platforms use X11 for wxWidgets
|
||||
#define MUST_INIT_X11 1
|
||||
#include <X11/Xlib.h>
|
||||
#else
|
||||
#define MUST_INIT_X11 0
|
||||
#endif
|
||||
|
||||
extern void RestartEngine();
|
||||
|
||||
using namespace std::literals;
|
||||
@@ -501,17 +493,6 @@ void EarlyInit()
|
||||
|
||||
FixLocales();
|
||||
|
||||
// Because we do GL calls from a secondary thread, Xlib needs to
|
||||
// be told to support multiple threads safely.
|
||||
// This is needed for Atlas, but we have to call it before any other
|
||||
// Xlib functions (e.g. the ones used when drawing the main menu
|
||||
// before launching Atlas)
|
||||
#if MUST_INIT_X11
|
||||
int status = XInitThreads();
|
||||
if (status == 0)
|
||||
debug_printf("Error enabling thread-safety via XInitThreads\n");
|
||||
#endif
|
||||
|
||||
// Initialise the low-quality rand function
|
||||
srand(time(NULL)); // NOTE: this rand should *not* be used for simulation!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user