Skip to content

Commit

Permalink
Forgot these two files
Browse files Browse the repository at this point in the history
  • Loading branch information
hkhauke committed Apr 18, 2024
1 parent 04a78f0 commit 44357c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 44357c5

Please sign in to comment.