diff --git a/ui.h b/ui.h index 3eb95129..90c41f03 100644 --- a/ui.h +++ b/ui.h @@ -8,6 +8,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _UI_EXTERN #define _UI_EXTERN extern #endif @@ -515,4 +519,8 @@ struct uiAreaKeyEvent { int Up; }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/ui_darwin.h b/ui_darwin.h index e70f8aa3..ffd7c9c9 100644 --- a/ui_darwin.h +++ b/ui_darwin.h @@ -7,6 +7,10 @@ This file assumes that you have imported and "ui.h" beforehand. #ifndef __LIBUI_UI_DARWIN_H__ #define __LIBUI_UI_DARWIN_H__ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct uiDarwinControl uiDarwinControl; struct uiDarwinControl { uiControl c; @@ -65,4 +69,8 @@ _UI_EXTERN void uiDarwinSetControlFont(NSControl *c, NSControlSize size); // You can use this function from within your control implementations to return text strings that can be freed with uiFreeText(). _UI_EXTERN char *uiDarwinNSStringToText(NSString *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/ui_unix.h b/ui_unix.h index 17f50184..070e6a39 100644 --- a/ui_unix.h +++ b/ui_unix.h @@ -7,6 +7,10 @@ This file assumes that you have included and "ui.h" beforehand. It p #ifndef __LIBUI_UI_UNIX_H__ #define __LIBUI_UI_UNIX_H__ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct uiUnixControl uiUnixControl; struct uiUnixControl { uiControl c; @@ -54,4 +58,8 @@ _UI_EXTERN void uiUnixFinishControl(uiControl *c); // uiUnixStrdupText() takes the given string and produces a copy of it suitable for being freed by uiFreeText(). extern char *uiUnixStrdupText(const char *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/ui_windows.h b/ui_windows.h index 9c3b6d74..3db6592e 100644 --- a/ui_windows.h +++ b/ui_windows.h @@ -7,6 +7,10 @@ This file assumes that you have included and "ui.h" beforehand. It p #ifndef __LIBUI_UI_WINDOWS_H__ #define __LIBUI_UI_WINDOWS_H__ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct uiWindowsSizing uiWindowsSizing; typedef struct uiWindowsControl uiWindowsControl; @@ -157,4 +161,8 @@ _UI_EXTERN void uiWindowsUnregisterWM_HSCROLLHandler(HWND); _UI_EXTERN void uiWindowsRegisterReceiveWM_WININICHANGE(HWND); _UI_EXTERN void uiWindowsUnregisterReceiveWM_WININICHANGE(HWND); +#ifdef __cplusplus +} +#endif + #endif