aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-03-09 17:24:03 -0800
committerChris Robinson <[email protected]>2018-03-09 17:24:03 -0800
commit30821e978b69fa017cbcd76e5ff25c62f16b1d2a (patch)
tree6c47c2d5f96d95c46de636a79cbb2e21fb39308f
parentc0e7a5b8b07132f39e7bf60371586d5d56984e14 (diff)
Add extern "C" to some headers
-rw-r--r--Alc/alstring.h8
-rw-r--r--Alc/backends/base.h8
-rw-r--r--Alc/compat.h8
-rw-r--r--Alc/logging.h8
-rw-r--r--Alc/ringbuffer.h8
-rw-r--r--OpenAL32/Include/alMain.h34
6 files changed, 57 insertions, 17 deletions
diff --git a/Alc/alstring.h b/Alc/alstring.h
index e10811da..923a5ea2 100644
--- a/Alc/alstring.h
+++ b/Alc/alstring.h
@@ -6,6 +6,10 @@
#include "vector.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef char al_string_char_type;
TYPEDEF_VECTOR(al_string_char_type, al_string)
TYPEDEF_VECTOR(al_string, vector_al_string)
@@ -47,4 +51,8 @@ void alstr_copy_wrange(al_string *str, const wchar_t *from, const wchar_t *to);
void alstr_append_wrange(al_string *str, const wchar_t *from, const wchar_t *to);
#endif
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* ALSTRING_H */
diff --git a/Alc/backends/base.h b/Alc/backends/base.h
index b05523b2..6940a2a2 100644
--- a/Alc/backends/base.h
+++ b/Alc/backends/base.h
@@ -5,6 +5,10 @@
#include "threads.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct ClockLatency {
ALint64 ClockTime;
ALint64 Latency;
@@ -157,4 +161,8 @@ inline void ALCdevice_Lock(ALCdevice *device)
inline void ALCdevice_Unlock(ALCdevice *device)
{ V0(device->Backend,unlock)(); }
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* AL_BACKENDS_BASE_H */
diff --git a/Alc/compat.h b/Alc/compat.h
index 6cf2d0d2..093184c8 100644
--- a/Alc/compat.h
+++ b/Alc/compat.h
@@ -3,6 +3,10 @@
#include "alstring.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
@@ -54,4 +58,8 @@ void *GetSymbol(void *handle, const char *name);
void *Android_GetJNIEnv(void);
#endif
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* AL_COMPAT_H */
diff --git a/Alc/logging.h b/Alc/logging.h
index 18093b75..785771c8 100644
--- a/Alc/logging.h
+++ b/Alc/logging.h
@@ -10,6 +10,10 @@
#define DECL_FORMAT(x, y, z)
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern FILE *LogFile;
#if defined(__GNUC__) && !defined(_WIN32)
@@ -58,4 +62,8 @@ extern enum LogLevel LogLevel;
LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \
} while(0)
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* LOGGING_H */
diff --git a/Alc/ringbuffer.h b/Alc/ringbuffer.h
index bcf67374..0d05ec84 100644
--- a/Alc/ringbuffer.h
+++ b/Alc/ringbuffer.h
@@ -4,6 +4,10 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct ll_ringbuffer ll_ringbuffer_t;
typedef struct ll_ringbuffer_data {
char *buf;
@@ -66,4 +70,8 @@ size_t ll_ringbuffer_write(ll_ringbuffer_t *rb, const char *src, size_t cnt);
/** Advance the write pointer `cnt' places. */
void ll_ringbuffer_write_advance(ll_ringbuffer_t *rb, size_t cnt);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* RINGBUFFER_H */
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 6d6d661f..783a90de 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -49,19 +49,6 @@
#define UNLIKELY(x) (!!(x))
#endif
-typedef ALint64SOFT ALint64;
-typedef ALuint64SOFT ALuint64;
-
-#ifndef U64
-#if defined(_MSC_VER)
-#define U64(x) ((ALuint64)(x##ui64))
-#elif SIZEOF_LONG == 8
-#define U64(x) ((ALuint64)(x##ul))
-#elif SIZEOF_LONG_LONG == 8
-#define U64(x) ((ALuint64)(x##ull))
-#endif
-#endif
-
#ifndef UINT64_MAX
#define UINT64_MAX U64(18446744073709551615)
#endif
@@ -85,6 +72,23 @@ typedef ALuint64SOFT ALuint64;
#define FAM_SIZE(T, M, N) (offsetof(T, M) + sizeof(((T*)NULL)->M[0])*(N))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ALint64SOFT ALint64;
+typedef ALuint64SOFT ALuint64;
+
+#ifndef U64
+#if defined(_MSC_VER)
+#define U64(x) ((ALuint64)(x##ui64))
+#elif SIZEOF_LONG == 8
+#define U64(x) ((ALuint64)(x##ul))
+#elif SIZEOF_LONG_LONG == 8
+#define U64(x) ((ALuint64)(x##ull))
+#endif
+#endif
+
/* Define a CTZ64 macro (count trailing zeros, for 64-bit integers). The result
* is *UNDEFINED* if the value is 0.
*/
@@ -153,10 +157,6 @@ static const union {
#define COUNTOF(x) (sizeof(x) / sizeof(0[x]))
-#ifdef __cplusplus
-extern "C" {
-#endif
-
struct ll_ringbuffer;
struct Hrtf;
struct HrtfEntry;