Skip to content

Commit

Permalink
Compile in C17 mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale committed May 8, 2024
1 parent 5a87c50 commit a6b0e34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions ffcx/codegeneration/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@ def _compile_objects(
ufl_objects, prefix=module_name, options=options, visualise=visualise
)

# Compile in C17 mode
if sys.platform.startswith("win32"):
CFFI_BASE_COMPILE_ARGS = ["/std:c17"]
else:
CFFI_BASE_COMPILE_ARGS = ["-std=c17"]

cffi_extra_compile_args += CFFI_BASE_COMPILE_ARGS

ffibuilder = cffi.FFI()

ffibuilder.set_source(
Expand Down
4 changes: 2 additions & 2 deletions ffcx/codegeneration/ufcx.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ extern "C"
{

#if defined(__clang__)
#define restrict
#elif defined(__GNUC__) || defined(__GNUG__)
#define restrict __restrict
#elif defined(__GNUG__)
#define restrict __restrict__
#elif defined(_MSC_VER)
#define restrict __restrict
Expand Down

0 comments on commit a6b0e34

Please sign in to comment.