diff --git a/lib_paysages/clouds.h b/lib_paysages/clouds.h index f430bf0..fa354ef 100644 --- a/lib_paysages/clouds.h +++ b/lib_paysages/clouds.h @@ -4,6 +4,10 @@ #include "shared/types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { double ycenter; @@ -45,4 +49,8 @@ CloudsQuality cloudsGetQuality(); Color cloudsGetColorCustom(Vector3 start, Vector3 end, CloudsDefinition* definition, CloudsQuality* quality, CloudsEnvironment* environment); Color cloudsGetColor(Vector3 start, Vector3 end); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/shared/constants.h b/lib_paysages/shared/constants.h index b64c870..c7ad627 100644 --- a/lib_paysages/shared/constants.h +++ b/lib_paysages/shared/constants.h @@ -3,6 +3,10 @@ #include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + extern Color COLOR_TRANSPARENT; extern Color COLOR_BLACK; extern Color COLOR_RED; @@ -13,4 +17,8 @@ extern Color COLOR_GREY; extern Vector3 VECTOR_ZERO; +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/shared/functions.h b/lib_paysages/shared/functions.h index 246d994..fca8ad6 100644 --- a/lib_paysages/shared/functions.h +++ b/lib_paysages/shared/functions.h @@ -4,6 +4,10 @@ #include "types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + void paysagesInit(); /* array.c */ @@ -211,4 +215,8 @@ void zoneAddHeightRange(Zone* zone, double value, double hardmin, double softmin void zoneAddSteepnessRange(Zone* zone, double value, double hardmin, double softmin, double softmax, double hardmax); double zoneGetValue(Zone* zone, Vector3 location, Vector3 normal); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/shared/globals.h b/lib_paysages/shared/globals.h index 8d33443..0241128 100644 --- a/lib_paysages/shared/globals.h +++ b/lib_paysages/shared/globals.h @@ -3,6 +3,10 @@ #include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + extern Vector3 camera_location; extern int render_width; @@ -13,4 +17,8 @@ extern double sun_color_lum; extern Vector3 sun_direction; extern Vector3 sun_direction_inv; +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/shared/system.h b/lib_paysages/shared/system.h index d98965a..9822dbe 100644 --- a/lib_paysages/shared/system.h +++ b/lib_paysages/shared/system.h @@ -1,5 +1,12 @@ +#ifndef _PAYSAGES_SYSTEM_H_ +#define _PAYSAGES_SYSTEM_H_ + #include +#ifdef __cplusplus +extern "C" { +#endif + typedef GThread Thread; typedef void*(*ThreadFunction)(void* data); @@ -41,3 +48,8 @@ static inline void timeSleepMs(unsigned long ms) g_usleep(ms * 1000); } +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib_paysages/shared/types.h b/lib_paysages/shared/types.h index 3a207f5..bf47080 100644 --- a/lib_paysages/shared/types.h +++ b/lib_paysages/shared/types.h @@ -1,6 +1,10 @@ #ifndef _PAYSAGES_TYPES_H_ #define _PAYSAGES_TYPES_H_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { double x; @@ -104,7 +108,7 @@ struct NoiseLevel typedef struct NoiseLevel NoiseLevel; typedef struct NoiseGenerator NoiseGenerator; -typedef struct Zone Zone; +typedef struct Zone Zone; typedef struct HeightModifier HeightModifier; @@ -122,4 +126,8 @@ typedef struct } RayCastingResult; typedef RayCastingResult (*RayCastingFunction)(Vector3 start, Vector3 direction); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/sky.h b/lib_paysages/sky.h index 39bd97f..97e1b0e 100644 --- a/lib_paysages/sky.h +++ b/lib_paysages/sky.h @@ -4,6 +4,10 @@ #include "shared/types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { double daytime; @@ -46,4 +50,8 @@ Color skyGetColor(Vector3 eye, Vector3 look); Color skyProjectRay(Vector3 start, Vector3 direction); void skyRender(RenderProgressCallback callback); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib_paysages/water.h b/lib_paysages/water.h index 6554cd3..58200bb 100644 --- a/lib_paysages/water.h +++ b/lib_paysages/water.h @@ -4,6 +4,10 @@ #include "shared/types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { double height; @@ -55,4 +59,8 @@ WaterResult waterGetColorCustom(Vector3 location, Vector3 look, WaterDefinition* Color waterGetColor(Vector3 location, Vector3 look); void waterRender(RenderProgressCallback callback); +#ifdef __cplusplus +} +#endif + #endif