Added C++ extern guards.

This commit is contained in:
Pietro Gagliardi 2015-11-16 10:55:44 -05:00
parent 5e29d07d20
commit a9316a04b0
4 changed files with 32 additions and 0 deletions

8
ui.h
View File

@ -8,6 +8,10 @@
#include <stddef.h>
#include <stdint.h>
#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

View File

@ -7,6 +7,10 @@ This file assumes that you have imported <Cocoa/Cocoa.h> 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

View File

@ -7,6 +7,10 @@ This file assumes that you have included <gtk/gtk.h> 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

View File

@ -7,6 +7,10 @@ This file assumes that you have included <windows.h> 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