Commit 69ea52a0 authored by Ghislain MARY's avatar Ghislain MARY

Do not use getenv() and putenv() when building a Windows Universal App...

Do not use getenv() and putenv() when building a Windows Universal App otherwise the certification of the application fails.
parent 0e99446a
......@@ -78,6 +78,10 @@ foreach(KEYWORD "inline" "__inline__" "__inline")
endif()
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions("-DNO_GETENV" "-DNO_PUTENV")
endif()
configure_file(jconfig.h.cmake.in jconfig.h)
configure_file(jconfigint.h.cmake.in jconfigint.h)
......
......@@ -794,9 +794,11 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf,
cinfo->image_width=width;
cinfo->image_height=height;
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(flags&TJFLAG_NOREALLOC)
{
......@@ -913,9 +915,11 @@ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle,
cinfo->image_width=width;
cinfo->image_height=height;
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
......@@ -1107,9 +1111,11 @@ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
cinfo->image_width=width;
cinfo->image_height=height;
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(flags&TJFLAG_NOREALLOC)
{
......@@ -1382,9 +1388,11 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)
_throw("tjDecompress2(): Invalid argument");
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(setjmp(this->jerr.setjmp_buffer))
{
......@@ -1579,9 +1587,11 @@ DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,
dinfo->image_width=width;
dinfo->image_height=height;
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
{
......@@ -1754,9 +1764,11 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
|| height<0)
_throw("tjDecompressToYUVPlanes(): Invalid argument");
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(setjmp(this->jerr.setjmp_buffer))
{
......@@ -2013,9 +2025,11 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle,
|| t==NULL || flags<0)
_throw("tjTransform(): Invalid argument");
#ifndef NO_PUTENV
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
#endif
if(setjmp(this->jerr.setjmp_buffer))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment