diff --git a/tests/features/S2N_MADVISE_SUPPORTED.c b/tests/features/S2N_MADVISE_SUPPORTED.c index bdde35c050d..312f84627fa 100644 --- a/tests/features/S2N_MADVISE_SUPPORTED.c +++ b/tests/features/S2N_MADVISE_SUPPORTED.c @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -#include "utils/s2n_fork_detection_internal.h" +#include "utils/s2n_fork_detection_features.h" int main() { madvise(NULL, 0, 0); diff --git a/tests/features/S2N_MINHERIT_SUPPORTED.c b/tests/features/S2N_MINHERIT_SUPPORTED.c index 25a38253762..fc662367f36 100644 --- a/tests/features/S2N_MINHERIT_SUPPORTED.c +++ b/tests/features/S2N_MINHERIT_SUPPORTED.c @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -#include "utils/s2n_fork_detection_internal.h" +#include "utils/s2n_fork_detection_features.h" int main() { minherit(NULL, 0, 0); diff --git a/tests/unit/s2n_build_test.c b/tests/unit/s2n_build_test.c index e7f40949d15..0c8055bc3bb 100644 --- a/tests/unit/s2n_build_test.c +++ b/tests/unit/s2n_build_test.c @@ -12,6 +12,12 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +#ifndef _S2N_PRELUDE_INCLUDED +/* make sure s2n_prelude.h is includes as part of the compiler flags, if not then fail the build */ +#error "Expected s2n_prelude.h to be included as part of the compiler flags" +#endif + #define _GNU_SOURCE #include #include diff --git a/tls/s2n_config.c b/tls/s2n_config.c index 4db579dd465..2a23c7617b9 100644 --- a/tls/s2n_config.c +++ b/tls/s2n_config.c @@ -13,6 +13,11 @@ * permissions and limitations under the License. */ +#ifndef _S2N_PRELUDE_INCLUDED +/* make sure s2n_prelude.h is includes as part of the compiler flags, if not then fail the build */ +#error "Expected s2n_prelude.h to be included as part of the compiler flags" +#endif + #include #include diff --git a/utils/s2n_fork_detection.c b/utils/s2n_fork_detection.c index 6de67c1ee50..92d82cac604 100644 --- a/utils/s2n_fork_detection.c +++ b/utils/s2n_fork_detection.c @@ -15,7 +15,7 @@ /* force the internal header to be included first, since it modifies _GNU_SOURCE/_POSIX_C_SOURCE */ /* clang-format off */ -#include "utils/s2n_fork_detection_internal.h" +#include "utils/s2n_fork_detection_features.h" /* clang-format on */ #include "utils/s2n_fork_detection.h" diff --git a/utils/s2n_fork_detection_internal.h b/utils/s2n_fork_detection_features.h similarity index 100% rename from utils/s2n_fork_detection_internal.h rename to utils/s2n_fork_detection_features.h diff --git a/utils/s2n_prelude.h b/utils/s2n_prelude.h index cbb820c44b5..364cc82ca87 100644 --- a/utils/s2n_prelude.h +++ b/utils/s2n_prelude.h @@ -15,6 +15,9 @@ #pragma once +/* Let modules know that the prelude was included */ +#define _S2N_PRELUDE_INCLUDED + /* Define the POSIX API we are targeting */ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L