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