From d86f466fe9da2747ccb6d57e5cee34d2f39c5c0e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 29 Apr 2017 17:33:36 +0200 Subject: [PATCH] Turn video_driver_is_threaded into macro --- gfx/video_driver.c | 15 ++++++--------- gfx/video_driver.h | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 63c6e7c7c3..3f31d61fb9 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -88,6 +88,12 @@ display_lock = NULL; \ context_lock = NULL +#ifdef HAVE_THREADS +#define video_driver_is_threaded() ((!video_driver_is_hw_context() && video_driver_threaded) ? true : false) +#else +#define video_driver_is_threaded() (false) +#endif + #define video_driver_threaded_lock() \ if (video_driver_is_threaded()) \ video_driver_lock() @@ -360,15 +366,6 @@ void video_driver_set_threaded(bool val) video_driver_threaded = val; } -bool video_driver_is_threaded(void) -{ -#ifdef HAVE_THREADS - if (!video_driver_is_hw_context() && video_driver_threaded) - return true; -#endif - return false; -} - /** * video_driver_get_ptr: * diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 3f08cee111..869aae8e47 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -385,7 +385,6 @@ bool video_driver_get_hw_render_interface(const struct bool video_driver_get_viewport_info(struct video_viewport *viewport); void video_driver_set_title_buf(void); void video_driver_monitor_adjust_system_rates(void); -bool video_driver_is_threaded(void); /** * video_driver_find_handle: