From 178a700c16f49a0847eaf0fa6359203299d273c1 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Tue, 3 May 2011 15:58:25 +0000 Subject: [PATCH] Fix build This was SVN commit r9412. --- source/lib/sysdep/os/linux/dir_watch_fam.cpp | 4 ++-- source/lib/sysdep/os/linux/lcpu.cpp | 2 +- source/lib/sysdep/os/linux/ldbg.cpp | 4 ++-- source/lib/sysdep/os/osx/dir_watch.cpp | 4 ++-- source/lib/sysdep/os/osx/ocpu.cpp | 2 +- source/lib/sysdep/os/osx/odbg.cpp | 4 ++-- source/lib/sysdep/os/osx/osx.cpp | 8 ++++---- source/lib/sysdep/os/unix/unix.cpp | 20 ++++++++++---------- source/lib/sysdep/os/unix/x/x.cpp | 11 ++++++----- 9 files changed, 30 insertions(+), 29 deletions(-) diff --git a/source/lib/sysdep/os/linux/dir_watch_fam.cpp b/source/lib/sysdep/os/linux/dir_watch_fam.cpp index 3b459df0e5..55db71e9dd 100644 --- a/source/lib/sysdep/os/linux/dir_watch_fam.cpp +++ b/source/lib/sysdep/os/linux/dir_watch_fam.cpp @@ -154,7 +154,7 @@ static void* fam_event_loop(void*) } } -LibError dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) +Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) { // init already failed; don't try again or complain if(initialized == -1) @@ -203,7 +203,7 @@ LibError dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) -LibError dir_watch_Poll(DirWatchNotifications& notifications) +Status dir_watch_Poll(DirWatchNotifications& notifications) { if(initialized == -1) return ERR::FAIL; // NOWARN diff --git a/source/lib/sysdep/os/linux/lcpu.cpp b/source/lib/sysdep/os/linux/lcpu.cpp index 823b315c0c..d8608ea437 100644 --- a/source/lib/sysdep/os/linux/lcpu.cpp +++ b/source/lib/sysdep/os/linux/lcpu.cpp @@ -142,7 +142,7 @@ uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t processorMask) } -LibError os_cpu_CallByEachCPU(OsCpuCallback cb, uintptr_t cbData) +Status os_cpu_CallByEachCPU(OsCpuCallback cb, uintptr_t cbData) { for(size_t processor = 0; processor < os_cpu_NumProcessors(); processor++) { diff --git a/source/lib/sysdep/os/linux/ldbg.cpp b/source/lib/sysdep/os/linux/ldbg.cpp index 5c3f1c7bfa..f0cbed35c9 100644 --- a/source/lib/sysdep/os/linux/ldbg.cpp +++ b/source/lib/sysdep/os/linux/ldbg.cpp @@ -49,7 +49,7 @@ void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSki return bt[2]; } -LibError debug_DumpStack(wchar_t* buf, size_t max_chars, void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* buf, size_t max_chars, void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) { static const size_t N_FRAMES = 16; void *bt[N_FRAMES]; @@ -96,7 +96,7 @@ LibError debug_DumpStack(wchar_t* buf, size_t max_chars, void* UNUSED(context), return INFO::OK; } -LibError debug_ResolveSymbol(void* ptr_of_interest, wchar_t* sym_name, wchar_t* file, int* line) +Status debug_ResolveSymbol(void* ptr_of_interest, wchar_t* sym_name, wchar_t* file, int* line) { if (sym_name) *sym_name = 0; diff --git a/source/lib/sysdep/os/osx/dir_watch.cpp b/source/lib/sysdep/os/osx/dir_watch.cpp index 2378db95a2..dce8ed3a5d 100644 --- a/source/lib/sysdep/os/osx/dir_watch.cpp +++ b/source/lib/sysdep/os/osx/dir_watch.cpp @@ -25,12 +25,12 @@ // stub implementations -LibError dir_watch_Add(const OsPath& UNUSED(path), PDirWatch& UNUSED(dirWatch)) +Status dir_watch_Add(const OsPath& UNUSED(path), PDirWatch& UNUSED(dirWatch)) { return INFO::OK; } -LibError dir_watch_Poll(DirWatchNotifications& UNUSED(notifications)) +Status dir_watch_Poll(DirWatchNotifications& UNUSED(notifications)) { return INFO::OK; } diff --git a/source/lib/sysdep/os/osx/ocpu.cpp b/source/lib/sysdep/os/osx/ocpu.cpp index 053829d8f8..3658ad1251 100644 --- a/source/lib/sysdep/os/osx/ocpu.cpp +++ b/source/lib/sysdep/os/osx/ocpu.cpp @@ -108,7 +108,7 @@ uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t processorMask) } -LibError os_cpu_CallByEachCPU(OsCpuCallback cb, uintptr_t cbData) +Status os_cpu_CallByEachCPU(OsCpuCallback cb, uintptr_t cbData) { for(size_t processor = 0; processor < os_cpu_NumProcessors(); processor++) { diff --git a/source/lib/sysdep/os/osx/odbg.cpp b/source/lib/sysdep/os/osx/odbg.cpp index bf21d5a865..96ed88b045 100644 --- a/source/lib/sysdep/os/osx/odbg.cpp +++ b/source/lib/sysdep/os/osx/odbg.cpp @@ -33,12 +33,12 @@ void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSki return NULL; } -LibError debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) { return ERR::NOT_IMPLEMENTED; } -LibError debug_ResolveSymbol(void* UNUSED(ptr_of_interest), wchar_t* UNUSED(sym_name), wchar_t* UNUSED(file), int* UNUSED(line)) +Status debug_ResolveSymbol(void* UNUSED(ptr_of_interest), wchar_t* UNUSED(sym_name), wchar_t* UNUSED(file), int* UNUSED(line)) { return ERR::NOT_IMPLEMENTED; } diff --git a/source/lib/sysdep/os/osx/osx.cpp b/source/lib/sysdep/os/osx/osx.cpp index 52d1ea0424..1f126cedc0 100644 --- a/source/lib/sysdep/os/osx/osx.cpp +++ b/source/lib/sysdep/os/osx/osx.cpp @@ -31,7 +31,7 @@ // "copy" text into the clipboard. replaces previous contents. -LibError sys_clipboard_set(const wchar_t* text) +Status sys_clipboard_set(const wchar_t* text) { return INFO::OK; } @@ -48,7 +48,7 @@ wchar_t* sys_clipboard_get(void) // frees memory used by , which must have been returned by // sys_clipboard_get. see note above. -LibError sys_clipboard_free(wchar_t* copy) +Status sys_clipboard_free(wchar_t* copy) { // Since clipboard_get never returns allocated memory (unimplemented), we // should only ever get called with a NULL pointer. @@ -65,12 +65,12 @@ LibError sys_clipboard_free(wchar_t* copy) * @param xres, yres (optional out) resolution [pixels] * @param bpp (optional out) bits per pixel * @param freq (optional out) vertical refresh rate [Hz] - * @return LibError; INFO::OK unless: some information was requested + * @return Status; INFO::OK unless: some information was requested * (i.e. pointer is non-NULL) but cannot be returned. * on failure, the outputs are all left unchanged (they are * assumed initialized to defaults) **/ -LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) +Status gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) { // TODO Implement return ERR::NOT_IMPLEMENTED; diff --git a/source/lib/sysdep/os/unix/unix.cpp b/source/lib/sysdep/os/unix/unix.cpp index c553ed1b76..1e9535bfc3 100644 --- a/source/lib/sysdep/os/unix/unix.cpp +++ b/source/lib/sysdep/os/unix/unix.cpp @@ -83,7 +83,7 @@ static ErrorReactionInternal try_gui_display_error(const wchar_t* text, bool man // should only call async-signal-safe functions before exec. // So prepare all the child's data in advance, before forking: - LibError err; // ignore UTF-8 errors + Status err; // ignore UTF-8 errors std::string message = utf8_from_wstring(text, &err); // Replace CRLF->LF @@ -262,7 +262,7 @@ ErrorReactionInternal sys_display_error(const wchar_t* text, size_t flags) } -LibError sys_error_description_r(int err, wchar_t* buf, size_t max_chars) +Status sys_StatusDescription(int err, wchar_t* buf, size_t max_chars) { UNUSED2(err); UNUSED2(buf); @@ -279,7 +279,7 @@ LibError sys_error_description_r(int err, wchar_t* buf, size_t max_chars) // note: do not return ERR_NOT_IMPLEMENTED or similar because that // would result in WARN_ERRs. -LibError sys_cursor_create(size_t w, size_t h, void* bgra_img, size_t hx, size_t hy, sys_cursor* cursor) +Status sys_cursor_create(size_t w, size_t h, void* bgra_img, size_t hx, size_t hy, sys_cursor* cursor) { UNUSED2(w); UNUSED2(h); @@ -292,7 +292,7 @@ LibError sys_cursor_create(size_t w, size_t h, void* bgra_img, size_t hx, size_t } // returns a dummy value representing an empty cursor -LibError sys_cursor_create_empty(sys_cursor* cursor) +Status sys_cursor_create_empty(sys_cursor* cursor) { *cursor = (void*)1; // any non-zero value, since the cursor NULL has special meaning return INFO::OK; @@ -300,7 +300,7 @@ LibError sys_cursor_create_empty(sys_cursor* cursor) // replaces the current system cursor with the one indicated. need only be // called once per cursor; pass 0 to restore the default. -LibError sys_cursor_set(sys_cursor cursor) +Status sys_cursor_set(sys_cursor cursor) { if (cursor) // dummy empty cursor SDL_ShowCursor(SDL_DISABLE); @@ -312,7 +312,7 @@ LibError sys_cursor_set(sys_cursor cursor) // destroys the indicated cursor and frees its resources. if it is // currently the system cursor, the default cursor is restored first. -LibError sys_cursor_free(sys_cursor cursor) +Status sys_cursor_free(sys_cursor cursor) { // bail now to prevent potential confusion below; there's nothing to do. if(!cursor) @@ -323,7 +323,7 @@ LibError sys_cursor_free(sys_cursor cursor) return INFO::OK; } -LibError sys_cursor_reset() +Status sys_cursor_reset() { return INFO::OK; } @@ -356,7 +356,7 @@ std::wstring sys_get_user_name() return L""; } -LibError sys_generate_random_bytes(u8* buf, size_t count) +Status sys_generate_random_bytes(u8* buf, size_t count) { FILE* f = fopen("/dev/urandom", "rb"); if (!f) @@ -376,12 +376,12 @@ LibError sys_generate_random_bytes(u8* buf, size_t count) return INFO::OK; } -LibError sys_get_proxy_config(const std::wstring& UNUSED(url), std::wstring& UNUSED(proxy)) +Status sys_get_proxy_config(const std::wstring& UNUSED(url), std::wstring& UNUSED(proxy)) { return INFO::SKIPPED; } -LibError sys_open_url(const std::string& url) +Status sys_open_url(const std::string& url) { pid_t pid = fork(); if (pid < 0) diff --git a/source/lib/sysdep/os/unix/x/x.cpp b/source/lib/sysdep/os/unix/x/x.cpp index a0520d5a64..49d65f5145 100644 --- a/source/lib/sysdep/os/unix/x/x.cpp +++ b/source/lib/sysdep/os/unix/x/x.cpp @@ -46,6 +46,7 @@ #include #undef Cursor +#undef Status static Display *SDL_Display; static Window SDL_Window; @@ -56,7 +57,7 @@ static size_t selection_size=0; // useful for choosing a video mode. not called by detect(). // if we fail, outputs are unchanged (assumed initialized to defaults) -LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) +Status gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) { Display* disp = XOpenDisplay(0); if(!disp) @@ -90,7 +91,7 @@ LibError gfx_get_video_mode(int* xres, int* yres, int* bpp, int* freq) // useful for determining aspect ratio. not called by detect(). // if we fail, outputs are unchanged (assumed initialized to defaults) -LibError gfx_get_monitor_size(int& width_mm, int& height_mm) +Status gfx_get_monitor_size(int& width_mm, int& height_mm) { Display* disp = XOpenDisplay(0); if(!disp) @@ -212,7 +213,7 @@ wchar_t *sys_clipboard_get() return NULL; } -LibError sys_clipboard_free(wchar_t *clip_buf) +Status sys_clipboard_free(wchar_t *clip_buf) { free(clip_buf); return INFO::OK; @@ -281,7 +282,7 @@ int clipboard_filter(const SDL_Event *event) * Initialization for X clipboard handling, called on-demand by * sys_clipboard_set. */ -LibError x11_clipboard_init() +Status x11_clipboard_init() { SDL_SysWMinfo info; @@ -321,7 +322,7 @@ LibError x11_clipboard_init() *
  • Listen for Selection events and respond to them as appropriate * */ -LibError sys_clipboard_set(const wchar_t *str) +Status sys_clipboard_set(const wchar_t *str) { ONCE(x11_clipboard_init());