Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sycl/source/detail/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace detail {

#define CONFIG(Name, MaxSize, CompileTimeDef) \
const char *SYCLConfigBase<Name>::MValueFromFile = nullptr; \
char SYCLConfigBase<Name>::MStorage[MaxSize]; \
char SYCLConfigBase<Name>::MStorage[MaxSize + 1]; \
const char *const SYCLConfigBase<Name>::MCompileTimeDef = \
getStrOrNullptr(STRINGIFY_LINE(CompileTimeDef)); \
const char *const SYCLConfigBase<Name>::MConfigName = STRINGIFY_LINE(Name);
Expand All @@ -40,6 +40,7 @@ static void initValue(const char *Key, const char *Value) {
#define CONFIG(Name, MaxSize, CompileTimeDef) \
if (0 == strncmp(Key, SYCLConfigBase<Name>::MConfigName, MAX_CONFIG_NAME)) { \
strncpy(SYCLConfigBase<Name>::MStorage, Value, MaxSize); \
SYCLConfigBase<Name>::MStorage[MaxSize] = '\0'; \
SYCLConfigBase<Name>::MValueFromFile = SYCLConfigBase<Name>::MStorage; \
return; \
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <ConfigID Config> class SYCLConfigBase;
public: \
/*Preallocated storage for config value which is extracted from a config \
* file*/ \
static char MStorage[MaxSize]; \
static char MStorage[MaxSize + 1]; \
/*Points to the storage if config is set in the file, nullptr otherwise*/ \
static const char *MValueFromFile; \
/*The name of the config*/ \
Expand Down