From 923916ecce7b3f1f980aa6b4c4eadb7553cdcf17 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 18 Dec 2014 11:50:04 -0800 Subject: [PATCH] libobs: Use extern "C" on export headers if C++ I neglected to surround some files with extern "C", so if something written with C++ used the files it would cause function exports to not be mangled by it correctly. --- libobs/obs-encoder.h | 8 ++++++++ libobs/obs-output.h | 8 ++++++++ libobs/obs-service.h | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/libobs/obs-encoder.h b/libobs/obs-encoder.h index a725ca117..683144d11 100644 --- a/libobs/obs-encoder.h +++ b/libobs/obs-encoder.h @@ -25,6 +25,10 @@ * to process output data. */ +#ifdef __cplusplus +extern "C" { +#endif + /** Specifies the encoder type */ enum obs_encoder_type { OBS_ENCODER_AUDIO, /**< The encoder provides an audio codec */ @@ -230,3 +234,7 @@ EXPORT void obs_register_encoder_s(const struct obs_encoder_info *info, */ #define obs_register_encoder(info) \ obs_register_encoder_s(info, sizeof(struct obs_encoder_info)) + +#ifdef __cplusplus +} +#endif diff --git a/libobs/obs-output.h b/libobs/obs-output.h index 9ccd2c467..013f7c29a 100644 --- a/libobs/obs-output.h +++ b/libobs/obs-output.h @@ -17,6 +17,10 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #define OBS_OUTPUT_VIDEO (1<<0) #define OBS_OUTPUT_AUDIO (1<<1) #define OBS_OUTPUT_AV (OBS_OUTPUT_VIDEO | OBS_OUTPUT_AUDIO) @@ -63,3 +67,7 @@ EXPORT void obs_register_output_s(const struct obs_output_info *info, #define obs_register_output(info) \ obs_register_output_s(info, sizeof(struct obs_output_info)) + +#ifdef __cplusplus +} +#endif diff --git a/libobs/obs-service.h b/libobs/obs-service.h index 1d6adedeb..9c1d16f57 100644 --- a/libobs/obs-service.h +++ b/libobs/obs-service.h @@ -24,6 +24,10 @@ * Services are modules that implement provider specific settings for outputs. */ +#ifdef __cplusplus +extern "C" { +#endif + struct obs_service_info { /* required */ const char *id; @@ -67,3 +71,7 @@ EXPORT void obs_register_service_s(const struct obs_service_info *info, #define obs_register_service(info) \ obs_register_service_s(info, sizeof(struct obs_service_info)) + +#ifdef __cplusplus +} +#endif