X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=sys.h;h=f6cd464770cce2819cef5eab89c548add25a4f6c;hp=eb99088fee0c5c7100d36743c375a7725f787ce0;hb=HEAD;hpb=f847004b9818defbfd4bf15fe7b891fee2706079 diff --git a/sys.h b/sys.h index eb99088f..a5c6b275 100644 --- a/sys.h +++ b/sys.h @@ -42,14 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #endif # define DP_MOBILETOUCH 1 # define DP_FREETYPE_STATIC 1 -#elif TARGET_OS_IPHONE /* must come first because it also defines MACOSX */ -# define DP_OS_NAME "iPhoneOS" -# define DP_OS_STR "iphoneos" -# define USE_GLES2 1 -# define LINK_TO_ZLIB 1 -# define LINK_TO_LIBVORBIS 1 -# define DP_MOBILETOUCH 1 -# define DP_FREETYPE_STATIC 1 #elif defined(__linux__) # define DP_OS_NAME "Linux" # define DP_OS_STR "linux" @@ -71,9 +63,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #elif defined(__DragonFly__) # define DP_OS_NAME "DragonFlyBSD" # define DP_OS_STR "dragonflybsd" -#elif defined(MACOSX) -# define DP_OS_NAME "Mac OS X" -# define DP_OS_STR "osx" +#elif defined(__APPLE__) +# if TARGET_OS_IPHONE +# define DP_OS_NAME "iOS" +# define DP_OS_STR "ios" +# define USE_GLES2 1 +# define LINK_TO_ZLIB 1 +# define LINK_TO_LIBVORBIS 1 +# define DP_MOBILETOUCH 1 +# define DP_FREETYPE_STATIC 1 +# elif TARGET_OS_MAC +# define DP_OS_NAME "macOS" +# define DP_OS_STR "macos" +# endif #elif defined(__MORPHOS__) # define DP_OS_NAME "MorphOS" # define DP_OS_STR "morphos" @@ -148,7 +150,6 @@ typedef struct sys_s extern sys_t sys; -extern struct cvar_s sys_usenoclockbutbenchmark; // // DLL management @@ -203,16 +204,19 @@ char *Sys_TimeString(const char *timeformat); // system IO interface (these are the sys functions that need to be implemented in a new driver atm) // -/// an error will cause the entire program to exit +/// Causes the entire program to exit ASAP. +/// Trailing \n should be omitted. void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN; /// (may) output text to terminal which launched program -void Sys_Print(const char *text); +/// is POSIX async-signal-safe +/// textlen excludes any (optional) \0 terminator +void Sys_Print(const char *text, size_t textlen); +/// used to report failures inside Con_Printf() void Sys_Printf(const char *fmt, ...); /// INFO: This is only called by Host_Shutdown so we dont need testing for recursion -void Sys_Shutdown (void); -void Sys_Quit (int returnvalue); +void Sys_SDL_Shutdown(void); /*! on some build/platform combinations (such as Linux gcc with the -pg * profiling option) this can turn on/off profiling, used primarily to limit @@ -235,15 +239,18 @@ double Sys_DirtyTime(void); void Sys_ProvideSelfFD (void); +/// Reads a line from POSIX stdin or the Windows console char *Sys_ConsoleInput (void); /// called to yield for a little bit so as not to hog cpu when paused or debugging -void Sys_Sleep(int microseconds); +double Sys_Sleep(double time); +void Sys_SDL_Dialog(const char *title, const char *string); +void Sys_SDL_Init(void); /// Perform Key_Event () callbacks until the input que is empty -void Sys_SendKeyEvents (void); +void Sys_SDL_HandleEvents(void); -char *Sys_GetClipboardData (void); +char *Sys_SDL_GetClipboardData (void); extern qbool sys_supportsdlgetticks; unsigned int Sys_SDL_GetTicks (void); // wrapper to call SDL_GetTicks @@ -254,5 +261,7 @@ void Sys_InitProcessNice (void); void Sys_MakeProcessNice (void); void Sys_MakeProcessMean (void); +int Sys_Main(int argc, char *argv[]); + #endif