Skip to content

Commit

Permalink
Add compile guards to C version
Browse files Browse the repository at this point in the history
This will prevent compilation errors when including the library multiple times.

Signed-off-by: Igor Matheus Andrade Torrente <[email protected]>
  • Loading branch information
Igor Matheus Andrade Torrente committed Jan 20, 2021
1 parent 697a63f commit dc4cf44
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions C/FastNoiseLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2426,3 +2429,5 @@ void fnlDomainWarp3D(fnl_state *state, FNLfloat *x, FNLfloat *y, FNLfloat *z)
#if defined(__cplusplus)
}
#endif

#endif FASTNOISELITE_H

0 comments on commit dc4cf44

Please sign in to comment.