diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 266081225f..a4e174a434 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -172,7 +172,11 @@ static const char *win32_video_get_ident(void) return video_driver_get_ident(); } -static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, +#ifndef _MSC_VER +extern "C" { +#endif + +LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { settings_t *settings = config_get_ptr(); @@ -247,6 +251,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, return DefWindowProc(hwnd, message, wparam, lparam); } +#ifndef _MSC_VER +} +#endif + bool win32_window_create(void *data, unsigned style, RECT *mon_rect, unsigned width, unsigned height, bool fullscreen) diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index ece2dd6ba0..4bd0e91e61 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -62,7 +62,15 @@ bool win32_monitor_set_fullscreen(unsigned width, unsigned height, unsigned refresh, char *dev_name); #ifndef _XBOX -extern "C" bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name); +#ifdef __cplusplus +extern "C" { +#endif + +bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name); + +#ifdef __cplusplus +} +#endif #endif bool win32_window_create(void *data, unsigned style, diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 3bb857f32d..7305ebef33 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -111,6 +111,8 @@ typedef struct int parameters_start_y; } shader_dlg_t; +extern LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); + static shader_dlg_t g_shader_dlg = {0}; static INLINE void shader_dlg_refresh_trackbar_label(int index)