Skip to content

Commit

Permalink
remove LF_STRINGIFY stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Nov 6, 2024
1 parent a2397a8 commit e0724b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 10 additions & 3 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ macro(define X)
endif(DEFINED ${X})
endmacro()

macro(defineString X)
if(DEFINED ${X})
message(STATUS ${X}=\"${${X}}\")
target_compile_definitions(reactor-c PUBLIC ${X}=\"${${X}}\")
endif(DEFINED ${X})
endmacro()

# Search and apply all possible compile definitions
message(STATUS "Applying preprocessor definitions...")
define(_LF_CLOCK_SYNC_ATTENUATION)
Expand All @@ -178,9 +185,9 @@ define(NUMBER_OF_WORKERS)
define(NUMBER_OF_WATCHDOGS)
define(USER_THREADS)
define(SCHEDULER)
define(LF_SOURCE_DIRECTORY)
define(LF_SOURCE_GEN_DIRECTORY)
define(LF_PACKAGE_DIRECTORY)
define(LF_FILE_SEPARATOR)
define(WORKERS_NEEDED_FOR_FEDERATE)
define(LF_ENCLAVES)
defineString(LF_SOURCE_DIRECTORY)
defineString(LF_SOURCE_GEN_DIRECTORY)
defineString(LF_PACKAGE_DIRECTORY)
3 changes: 0 additions & 3 deletions include/core/utils/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ typedef struct lf_stat_ll {
#define LF_MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#endif

#define LF_STRINGIFY(x) _LF_STRINGIFY(x)
#define _LF_STRINGIFY(x) #x

/**
* The ID of this federate. For a non-federated execution, this will
* be -1. For a federated execution, it will be assigned when the generated function
Expand Down
4 changes: 2 additions & 2 deletions python/lib/pythontarget.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ PyObject* py_source_directory(PyObject* self, PyObject* args) {
PyErr_SetString(PyExc_RuntimeError, "LF_SOURCE_DIRECTORY constant is not defined.");
return NULL;
#else
return PyUnicode_DecodeFSDefault(LF_STRINGIFY(LF_SOURCE_DIRECTORY));
return PyUnicode_DecodeFSDefault(LF_SOURCE_DIRECTORY);
#endif
}

Expand All @@ -178,7 +178,7 @@ PyObject* py_package_directory(PyObject* self, PyObject* args) {
PyErr_SetString(PyExc_RuntimeError, "LF_PACKAGE_DIRECTORY constant is not defined.");
return NULL;
#else
return PyUnicode_DecodeFSDefault(LF_STRINGIFY(LF_PACKAGE_DIRECTORY));
return PyUnicode_DecodeFSDefault(LF_PACKAGE_DIRECTORY);
#endif
}

Expand Down

0 comments on commit e0724b7

Please sign in to comment.