From 576353ce3fd6292e1f2c58c5e47e21c93b05b0c5 Mon Sep 17 00:00:00 2001 From: Jeremy L Thompson Date: Wed, 16 Oct 2024 12:20:23 -0600 Subject: [PATCH] jit - allow <> includes other than math, std* --- interface/ceed-jit-tools.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/interface/ceed-jit-tools.c b/interface/ceed-jit-tools.c index a45054cfc9..7c341cb431 100644 --- a/interface/ceed-jit-tools.c +++ b/interface/ceed-jit-tools.c @@ -216,6 +216,9 @@ int CeedLoadSourceToInitializedBuffer(Ceed ceed, const char *source_file_path, C bool is_ceed_header = next_left_chevron && (next_new_line - next_left_chevron > 0) && (!strncmp(next_left_chevron, "", 14) || !strncmp(next_left_chevron, "", 17) || !strncmp(next_left_chevron, "", 17)); + bool is_std_header = + next_left_chevron && (next_new_line - next_left_chevron > 0) && + (!strncmp(next_left_chevron, "", 8) || !strncmp(next_left_chevron, "", 8)); if (is_local_header || is_ceed_header) { // ---- Build source path @@ -254,6 +257,13 @@ int CeedLoadSourceToInitializedBuffer(Ceed ceed, const char *source_file_path, C } CeedCall(CeedFree(&include_source_path)); CeedCall(CeedFree(&normalized_include_source_path)); + } else if (!is_std_header) { + long header_copy_size = next_new_line - first_hash + 1; + + CeedCall(CeedRealloc(current_size + copy_size + header_copy_size + 2, buffer)); + memcpy(&(*buffer)[current_size + copy_size], "\n", 2); + memcpy(&(*buffer)[current_size + copy_size + 1], first_hash, header_copy_size); + memcpy(&(*buffer)[current_size + copy_size + header_copy_size], "", 1); } file_offset = strchr(first_hash, '\n') - temp_buffer + 1; }