Declare variables extern in headers

Fixes linkage errors on GCC 10
master
outfrost 2020-06-01 02:04:33 +02:00
parent 12d840bc03
commit 59a4bb2a20
5 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ typedef enum {
LOGLEVEL_DEBUG LOGLEVEL_DEBUG
} LogLevel; } LogLevel;
LogLevel logLevel; extern LogLevel logLevel;
#define logError(...) logMessage(LOGLEVEL_ERROR, __func__, __VA_ARGS__) #define logError(...) logMessage(LOGLEVEL_ERROR, __func__, __VA_ARGS__)
#define logWarning(...) logMessage(LOGLEVEL_WARNING, __func__, __VA_ARGS__) #define logWarning(...) logMessage(LOGLEVEL_WARNING, __func__, __VA_ARGS__)

View File

@ -3,8 +3,8 @@
#include "scene.h" #include "scene.h"
float viewportAspectRatio; extern float viewportAspectRatio;
const Scene* cameraAnchor; extern const Scene* cameraAnchor;
void initRender(); void initRender();
void renderFrame(); void renderFrame();

View File

@ -13,7 +13,7 @@ struct Scene {
const Solid* solid; const Solid* solid;
}; };
Scene* currentScene; extern Scene* currentScene;
Scene* newScene(); Scene* newScene();
void insertChildScene(Scene* scene, Scene* newChild); void insertChildScene(Scene* scene, Scene* newChild);

View File

@ -26,7 +26,7 @@ typedef struct {
#define BLOCKGRID_CELL_SIZE 2.5f #define BLOCKGRID_CELL_SIZE 2.5f
BlockGrid levelGrid; extern BlockGrid levelGrid;
void initLevel(); void initLevel();
void startLevel(); void startLevel();

View File

@ -5,7 +5,7 @@
#include "engine/scene.h" #include "engine/scene.h"
Scene* playerCharacter; extern Scene* playerCharacter;
void initPlayer(); void initPlayer();
void spawnPlayer(Transform transform); void spawnPlayer(Transform transform);