diff --git a/Makefile b/Makefile index f37eeac..8e6299f 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,6 @@ cp: cp mdbxdist/mdbx.h mdbx/ cp mdbxdist/mdbx.c mdbx/ #add 1 line to mdbx.h about build flags which we have in `mdbx.go` + echo "$(echo '#ifndef MDBX_BUILD_FLAGS'; cat mdbx/mdbx.h)" > mdbx/mdbx.h echo "$(echo '#define MDBX_BUILD_FLAGS "-std=gnu11 -fvisibility=hidden -ffast-math"'; cat mdbx/mdbx.h)" > mdbx/mdbx.h + echo "$(echo '#endif'; cat mdbx/mdbx.h)" > mdbx/mdbx.h diff --git a/mdbx/mdbx.h b/mdbx/mdbx.h index ccb8b1c..acce125 100644 --- a/mdbx/mdbx.h +++ b/mdbx/mdbx.h @@ -1,3 +1,7 @@ +#ifndef MDBX_BUILD_FLAGS +#define MDBX_BUILD_FLAGS "-std=gnu11 -fvisibility=hidden -ffast-math" +#endif + /** _libmdbx_ (aka MDBX) is an extremely fast, compact, powerful, embeddable, @@ -38,7 +42,6 @@ credits and acknowledgments. #pragma once #ifndef LIBMDBX_H #define LIBMDBX_H -#define MDBX_BUILD_FLAGS "-std=gnu11 -fvisibility=hidden -ffast-math" #if defined(__riscv) || defined(__riscv__) || defined(__RISCV) || defined(__RISCV__) #warning "The RISC-V architecture is intentionally insecure by design. \