Add infamous #ifdef __cplusplus idiom

This commit is contained in:
Renato Rotenberg
2023-02-06 21:47:13 -03:00
parent c3eadb01b1
commit b873542526
2 changed files with 14 additions and 5 deletions
+12 -4
View File
@@ -15,6 +15,10 @@
#define SM64_LIB_FN #define SM64_LIB_FN
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
struct SM64Surface struct SM64Surface
{ {
int16_t type; int16_t type;
@@ -105,16 +109,16 @@ struct SM64SurfaceCollisionData
int8_t room; int8_t room;
int32_t lowerY; // libsm64: 32 bit int32_t lowerY; // libsm64: 32 bit
int32_t upperY; // libsm64: 32 bit int32_t upperY; // libsm64: 32 bit
int32_t vertex1[3]; // libsm64: 32 bit int32_t vertex1[3]; // libsm64: 32 bit
int32_t vertex2[3]; // libsm64: 32 bit int32_t vertex2[3]; // libsm64: 32 bit
int32_t vertex3[3]; // libsm64: 32 bit int32_t vertex3[3]; // libsm64: 32 bit
struct { struct {
float x; float x;
float y; float y;
float z; float z;
} normal; } normal;
float originOffset; float originOffset;
uint8_t isValid; // libsm64: added field uint8_t isValid; // libsm64: added field
struct SM64SurfaceObjectTransform *transform; // libsm64: added field struct SM64SurfaceObjectTransform *transform; // libsm64: added field
uint16_t terrain; // libsm64: added field uint16_t terrain; // libsm64: added field
@@ -186,4 +190,8 @@ extern SM64_LIB_FN void sm64_play_sound(int32_t soundBits, float *pos);
extern SM64_LIB_FN void sm64_play_sound_global(int32_t soundBits); extern SM64_LIB_FN void sm64_play_sound_global(int32_t soundBits);
extern SM64_LIB_FN void sm64_set_sound_volume(float vol); extern SM64_LIB_FN void sm64_set_sound_volume(float vol);
#ifdef __cplusplus
}
#endif
#endif//LIB_SM64_H #endif//LIB_SM64_H
+2 -1
View File
@@ -9,8 +9,9 @@
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
extern "C" {
#include "../src/libsm64.h" #include "../src/libsm64.h"
extern "C" {
#define SDL_MAIN_HANDLED #define SDL_MAIN_HANDLED
#include "level.h" #include "level.h"
#include "context.h" #include "context.h"