1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00

QB64_LINUX is now for linux exclusively

This commit is contained in:
Luke Ceddia 2018-01-16 20:22:32 +11:00
parent 1320d7fe52
commit 219bbc27f0
3 changed files with 18 additions and 19 deletions

View file

@ -22,7 +22,7 @@
#define QB64_GL1 #define QB64_GL1
#define QB64_GLUT #define QB64_GLUT
#ifdef QB64_LINUXONLY #ifdef QB64_LINUX
#define QB64_X11 #define QB64_X11
#endif #endif

View file

@ -319,7 +319,7 @@ extern "C" int qb64_custom_event(int event,int v1,int v2,int v3,int v4,int v5,in
extern "C" LRESULT qb64_os_event_windows(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, int *qb64_os_event_info); extern "C" LRESULT qb64_os_event_windows(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, int *qb64_os_event_info);
#endif #endif
#if defined(QB64_LINUXONLY) && defined(QB64_GUI) #if defined(QB64_LINUX) && defined(QB64_GUI)
extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info); extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info);
#endif #endif
@ -902,7 +902,7 @@ int64 orwl_gettime(void) {
} }
#endif #endif
#ifdef QB64_LINUXONLY #ifdef QB64_LINUX
int64 GetTicks(){ int64 GetTicks(){
struct timespec tp; struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp); clock_gettime(CLOCK_MONOTONIC, &tp);
@ -14436,7 +14436,7 @@ int32 func__hasfocus() {
#ifdef QB64_WINDOWS #ifdef QB64_WINDOWS
while (!window_handle){Sleep(100);} while (!window_handle){Sleep(100);}
return -(window_handle==GetForegroundWindow()); return -(window_handle==GetForegroundWindow());
#elif defined(QB64_LINUXONLY) #elif defined(QB64_LINUX)
return window_focused; return window_focused;
#endif #endif
#endif #endif
@ -24227,7 +24227,7 @@ int32 func__exit(){
#if defined(QB64_LINUXONLY) && defined(QB64_X11) #if defined(QB64_LINUX) && defined(QB64_X11)
//X11 clipboard interface for Linux //X11 clipboard interface for Linux
//SDL_SysWMinfo syswminfo; //SDL_SysWMinfo syswminfo;
@ -24414,7 +24414,7 @@ if (x11selectionowner!=None){
return; return;
#endif #endif
#if defined(QB64_LINUXONLY) && defined(QB64_X11) #if defined(QB64_LINUX) && defined(QB64_X11)
static qbs *textz=NULL; if (!textz) textz=qbs_new(0,0); static qbs *textz=NULL; if (!textz) textz=qbs_new(0,0);
qbs_set(textz,qbs_add(text,qbs_new_txt_len("\0",1))); qbs_set(textz,qbs_add(text,qbs_new_txt_len("\0",1)));
x11clipboardcopy((char*)textz->chr); x11clipboardcopy((char*)textz->chr);
@ -24641,7 +24641,7 @@ return -1;
return NULL; return NULL;
#endif #endif
#if defined(QB64_LINUXONLY) && defined(QB64_X11) #if defined(QB64_LINUX) && defined(QB64_X11)
qbs *text; qbs *text;
char *cp=x11clipboardpaste(); char *cp=x11clipboardpaste();
cp=x11clipboardpaste(); cp=x11clipboardpaste();
@ -27590,7 +27590,7 @@ return -1;
#else #else
tqbs=qbs_new_txt("[WINDOWS][64BIT]"); tqbs=qbs_new_txt("[WINDOWS][64BIT]");
#endif #endif
#elif defined(QB64_LINUXONLY) #elif defined(QB64_LINUX)
#ifdef QB64_32 #ifdef QB64_32
tqbs=qbs_new_txt("[LINUX][32BIT]"); tqbs=qbs_new_txt("[LINUX][32BIT]");
#else #else
@ -29682,7 +29682,7 @@ qbs *func__dir(qbs* context_in){
extern void set_dynamic_info(); extern void set_dynamic_info();
int main( int argc, char* argv[] ){ int main( int argc, char* argv[] ){
#if defined(QB64_LINUXONLY) && defined(X11) #if defined(QB64_LINUX) && defined(X11)
XInitThreads(); XInitThreads();
#endif #endif
@ -29961,7 +29961,7 @@ qbs_set(startDir,func__cwd());
} }
} }
chdir(exepath); chdir(exepath);
#elif defined(QB64_LINUXONLY) #elif defined(QB64_LINUX)
{ {
char pathbuf[65536]; char pathbuf[65536];
memset(pathbuf, 0, sizeof(pathbuf)); memset(pathbuf, 0, sizeof(pathbuf));
@ -32746,7 +32746,7 @@ QB64_GAMEPAD_INIT();
} }
#endif #endif
#if defined(QB64_LINUXONLY) && defined(QB64_GUI) #if defined(QB64_LINUX) && defined(QB64_GUI)
extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info){ extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info){
if (*qb64_os_event_info==OS_EVENT_PRE_PROCESSING){ if (*qb64_os_event_info==OS_EVENT_PRE_PROCESSING){

View file

@ -1,13 +1,14 @@
/* Provide some OS/compiler macros. Note that a Mac has QB64_LINUX too /* Provide some OS/compiler macros.
* QB64_WINDOWS: Is this a Windows system? * QB64_WINDOWS: Is this a Windows system?
* QB64_LINUX: Is this a Linux system?
* QB64_MACOSX: Is this MacOSX, or MacOS or whatever Apple calls it now?
* QB64_UNIX: Is this a Unix-flavoured system?
*
* QB64_BACKSLASH_FILESYSTEM: Does this system use \ for file paths (as opposed to /)? * QB64_BACKSLASH_FILESYSTEM: Does this system use \ for file paths (as opposed to /)?
* QB64_MICROSOFT: Are we compiling with Visual Studio? * QB64_MICROSOFT: Are we compiling with Visual Studio?
* QB64_GCC: Are we compiling with gcc? * QB64_GCC: Are we compiling with gcc?
* QB64_MINGW: Are we compiling with MinGW, specifically? (Set in addition to QB64_GCC) * QB64_MINGW: Are we compiling with MinGW, specifically? (Set in addition to QB64_GCC)
* QB64_LINUX: Is this a Unix system? *
* QB64_UNIX: Alias of above
* QB64_LINUXONLY: Is this a Linux system?
* QB64_MACOSX: Is this MacOSX, or MacOS or whatever Apple calls it now?
* QB64_32: A 32bit system (the default) * QB64_32: A 32bit system (the default)
* QB64_64: A 64bit system (assumes all Macs are 64 bit) * QB64_64: A 64bit system (assumes all Macs are 64 bit)
*/ */
@ -23,11 +24,9 @@
#endif #endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
#define QB64_MACOSX #define QB64_MACOSX
#define QB64_LINUX
#define QB64_UNIX #define QB64_UNIX
#define QB64_GCC #define QB64_GCC
#elif defined(__linux__) #elif defined(__linux__)
#define QB64_LINUXONLY
#define QB64_LINUX #define QB64_LINUX
#define QB64_UNIX #define QB64_UNIX
#define QB64_GCC #define QB64_GCC
@ -35,7 +34,7 @@
#error "Unknown system; refusing to build. Edit os.h if needed" #error "Unknown system; refusing to build. Edit os.h if needed"
#endif #endif
#if _WIN64 || __x86_64__ || __ppc64__ || QB64_MACOSX #if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX)
#define QB64_64 #define QB64_64
#else #else
#define QB64_32 #define QB64_32