Skip to content

Commit

Permalink
Fix the Windows build. I remember now why I used putenv() originally-…
Browse files Browse the repository at this point in the history
…- because Windows doesn't have setenv(). We could use _putenv_s(), but older versions of MinGW don't have that either. Fortunately, since all of the environment values we're setting in turbojpeg.c are static, we can just map setenv() to putenv() using a macro. NOTE: we still have to use _putenv_s() in turbojpeg-jni.c, but at least people who may need to build with an older version of MinGW can still do so by disabling the Java build.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1555 632fc199-4ca6-4c93-a231-07263d6284db
  • Loading branch information
dcommander committed May 16, 2015
1 parent c15c2d8 commit a19f3a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turbojpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "transupp.h"
#include "./jpegcomp.h"

#ifdef _WIN32
#define setenv(envvar, value, dummy) putenv(envvar"="value)
#endif

extern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **,
unsigned long *, boolean);
extern void jpeg_mem_src_tj(j_decompress_ptr, unsigned char *, unsigned long);
Expand Down

0 comments on commit a19f3a9

Please sign in to comment.