Add extern "C" to some headers

This commit is contained in:
Chris Robinson
2018-03-09 17:24:03 -08:00
parent c0e7a5b8b0
commit 30821e978b
6 changed files with 57 additions and 17 deletions
+8
View File
@@ -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 */
+8
View File
@@ -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 */
+8
View File
@@ -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 */
+8
View File
@@ -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 */
+8
View File
@@ -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 */
+17 -17
View File
@@ -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;