Merge pull request #36 from Brawmario/feature/cpp-include

Add infamous `#ifdef __cplusplus` idiom
This commit is contained in:
Jeremy Burns 2023-02-08 16:31:47 -07:00 committed by GitHub
commit cf01dcddfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -15,6 +15,10 @@
#define SM64_LIB_FN
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct SM64Surface
{
int16_t type;
@ -105,9 +109,9 @@ struct SM64SurfaceCollisionData
int8_t room;
int32_t lowerY; // libsm64: 32 bit
int32_t upperY; // libsm64: 32 bit
int32_t vertex1[3]; // libsm64: 32 bit
int32_t vertex2[3]; // libsm64: 32 bit
int32_t vertex3[3]; // libsm64: 32 bit
int32_t vertex1[3]; // libsm64: 32 bit
int32_t vertex2[3]; // libsm64: 32 bit
int32_t vertex3[3]; // libsm64: 32 bit
struct {
float x;
float y;
@ -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_set_sound_volume(float vol);
#ifdef __cplusplus
}
#endif
#endif//LIB_SM64_H

View file

@ -9,8 +9,9 @@
#include <unistd.h>
#include <pthread.h>
extern "C" {
#include "../src/libsm64.h"
extern "C" {
#define SDL_MAIN_HANDLED
#include "level.h"
#include "context.h"