From dc4cf4494e61f57efd485e6c66809b42895dbc56 Mon Sep 17 00:00:00 2001 From: Igor Matheus Andrade Torrente Date: Wed, 20 Jan 2021 19:43:18 -0300 Subject: [PATCH] Add compile guards to C version This will prevent compilation errors when including the library multiple times. Signed-off-by: Igor Matheus Andrade Torrente --- C/FastNoiseLite.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C/FastNoiseLite.h b/C/FastNoiseLite.h index 522349b..101be8c 100644 --- a/C/FastNoiseLite.h +++ b/C/FastNoiseLite.h @@ -49,6 +49,9 @@ // In *one* C or C++ file, use #define FNL_IMPL to generate implementation +#ifndef FASTNOISELITE_H +#define FASTNOISELITE_H + // Switch between using floats or doubles for input position typedef float FNLfloat; //typedef double FNLfloat; @@ -2426,3 +2429,5 @@ void fnlDomainWarp3D(fnl_state *state, FNLfloat *x, FNLfloat *y, FNLfloat *z) #if defined(__cplusplus) } #endif + +#endif FASTNOISELITE_H