From 44357c5ead444fad1a7ed00d4db7102731cf2c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hauke=20Kr=C3=BCger?= Date: Thu, 18 Apr 2024 18:17:34 +0200 Subject: [PATCH] Forgot these two files --- .../platform/common_ux/jvx_system_misc_ux.h | 26 +++++++++++++++++++ .../platform/windows/jvx_system_misc.h | 9 +++++++ 2 files changed, 35 insertions(+) create mode 100644 sources/jvxLibraries/jvx-system-min/include/platform/common_ux/jvx_system_misc_ux.h create mode 100644 sources/jvxLibraries/jvx-system-min/include/platform/windows/jvx_system_misc.h diff --git a/sources/jvxLibraries/jvx-system-min/include/platform/common_ux/jvx_system_misc_ux.h b/sources/jvxLibraries/jvx-system-min/include/platform/common_ux/jvx_system_misc_ux.h new file mode 100644 index 00000000..cb1991c9 --- /dev/null +++ b/sources/jvxLibraries/jvx-system-min/include/platform/common_ux/jvx_system_misc_ux.h @@ -0,0 +1,26 @@ +#ifndef _JVX_SYSTEM_MISC_UX_H__ +#define _JVX_SYSTEM_MISC_UX_H__ + +JVX_STATIC_INLINE bool JVX_GETENVIRONMENTVARIABLE(char* var,char* bufRet,int ll) +{ + const char* varP = getenv(var); + std::string str = ""; + memset(bufRet, 0, sizeof(char)*ll); + if(varP) + { + str = varP; +// for(int i = 0; i < ll; i++) +// { +// bufRet[i] = varP[i]; + //if(varP[i] == 0) + // break; +// } + memcpy(bufRet, str.c_str(), sizeof(char)*str.size()); + return(true); + } + return(false); +} + +#define JVX_SETENVIRONMENTVARIABLE(var, value, set) setenv(var, value, set) + +#endif diff --git a/sources/jvxLibraries/jvx-system-min/include/platform/windows/jvx_system_misc.h b/sources/jvxLibraries/jvx-system-min/include/platform/windows/jvx_system_misc.h new file mode 100644 index 00000000..d47daa3d --- /dev/null +++ b/sources/jvxLibraries/jvx-system-min/include/platform/windows/jvx_system_misc.h @@ -0,0 +1,9 @@ +#ifndef _JVX_SYSTEM_MISC_H__ +#define _JVX_SYSTEM_MISC_H__ + +// These macros need to be part of the C environment + +#define JVX_GETENVIRONMENTVARIABLE(a,b,c) GetEnvironmentVariableA(a, b, c) +#define JVX_SETENVIRONMENTVARIABLE(a, b, overwrite_not_in_mswin) SetEnvironmentVariableA(a, b) + +#endif \ No newline at end of file