https://github.com/JuliaLang/julia
Raw File
Tip revision: 73627a6a4fa89b5ed5d957918f921b61694fd5d5 authored by Kristoffer on 03 February 2023, 09:59:28 UTC
put back DelimitedFiles as a non-sysimage stdlib, disable Pkg from considering DelimitedFiles as na stdlib
Tip revision: 73627a6
julia_assert.h
// This file is a part of Julia. License is MIT: https://julialang.org/license

// Include this file instead of `assert.h` directly.
// This is necessary because LLVM sometimes has bugs that cause runtime assertion if
// the `NDEBUG` setting is different from the one used to compile LLVM.
// For C++ files, we set `NDEBUG` to match what LLVM expects and use `JL_NDEBUG` to
// enable assertions in julia code. After including this file, the definition of `assert` will
// match the setting given in `JL_NDEBUG` and `NDEBUG` will remain unchanged.
//
// Files that need `assert` should include this file after all other includes.
// All files should also check `JL_NDEBUG` instead of `NDEBUG`.

#ifdef NDEBUG
#  ifndef JL_NDEBUG
#    undef NDEBUG
#    include <assert.h>
// Set NDEBUG back so that we can include another LLVM header right after
#    define NDEBUG
#  else
#    include <assert.h>
#  endif
#else
#  ifdef JL_NDEBUG
#    define NDEBUG
#    include <assert.h>
#    undef NDEBUG
#  else
#    include <assert.h>
#  endif
#endif
back to top