Back out r1555 and r1548. Using setenv() didn't fix the iOS simulator issue. It just replaced an undefined _putenv$UNIX2003 symbol with an undefined _setenv$UNIX2003 symbol. The correct solution seems to be to use -D_NONSTD_SOURCE when generating our official builds.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1557 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -43,11 +43,7 @@ builds of libjpeg-turbo to incorrectly encode a few specific test images when
|
|||||||
quality=98, an optimized Huffman table, and the slow integer forward DCT were
|
quality=98, an optimized Huffman table, and the slow integer forward DCT were
|
||||||
used.
|
used.
|
||||||
|
|
||||||
[8] Resolved an issue whereby the "official" TurboJPEG static library for OS X/
|
[8] The Windows (CMake) build system now supports building only static or only
|
||||||
iOS would produce an undefined symbol error (_putenv$UNIX2003) when attempting
|
|
||||||
to link the library with an i386 iOS application for the iOS simulator.
|
|
||||||
|
|
||||||
[9] The Windows (CMake) build system now supports building only static or only
|
|
||||||
shared libraries. This is accomplished by adding either -DENABLE_STATIC=0 or
|
shared libraries. This is accomplished by adding either -DENABLE_STATIC=0 or
|
||||||
-DENABLE_SHARED=0 to the CMake command line.
|
-DENABLE_SHARED=0 to the CMake command line.
|
||||||
|
|
||||||
|
|||||||
48
turbojpeg.c
48
turbojpeg.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C)2009-2015 D. R. Commander. All Rights Reserved.
|
* Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@@ -42,10 +42,6 @@
|
|||||||
#include "transupp.h"
|
#include "transupp.h"
|
||||||
#include "./jpegcomp.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 **,
|
extern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **,
|
||||||
unsigned long *, boolean);
|
unsigned long *, boolean);
|
||||||
extern void jpeg_mem_src_tj(j_decompress_ptr, unsigned char *, unsigned long);
|
extern void jpeg_mem_src_tj(j_decompress_ptr, unsigned char *, unsigned long);
|
||||||
@@ -758,9 +754,9 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
|
|||||||
cinfo->image_width=width;
|
cinfo->image_width=width;
|
||||||
cinfo->image_height=height;
|
cinfo->image_height=height;
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(flags&TJFLAG_NOREALLOC)
|
if(flags&TJFLAG_NOREALLOC)
|
||||||
{
|
{
|
||||||
@@ -874,9 +870,9 @@ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, unsigned char *srcBuf,
|
|||||||
cinfo->image_width=width;
|
cinfo->image_width=width;
|
||||||
cinfo->image_height=height;
|
cinfo->image_height=height;
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
|
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
|
||||||
|
|
||||||
@@ -1065,9 +1061,9 @@ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
|
|||||||
cinfo->image_width=width;
|
cinfo->image_width=width;
|
||||||
cinfo->image_height=height;
|
cinfo->image_height=height;
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(flags&TJFLAG_NOREALLOC)
|
if(flags&TJFLAG_NOREALLOC)
|
||||||
{
|
{
|
||||||
@@ -1335,9 +1331,9 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf,
|
|||||||
|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)
|
|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)
|
||||||
_throw("tjDecompress2(): Invalid argument");
|
_throw("tjDecompress2(): Invalid argument");
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(setjmp(this->jerr.setjmp_buffer))
|
if(setjmp(this->jerr.setjmp_buffer))
|
||||||
{
|
{
|
||||||
@@ -1530,9 +1526,9 @@ DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,
|
|||||||
dinfo->image_width=width;
|
dinfo->image_width=width;
|
||||||
dinfo->image_height=height;
|
dinfo->image_height=height;
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
|
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
|
||||||
{
|
{
|
||||||
@@ -1703,9 +1699,9 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
|
|||||||
|| height<0)
|
|| height<0)
|
||||||
_throw("tjDecompressToYUVPlanes(): Invalid argument");
|
_throw("tjDecompressToYUVPlanes(): Invalid argument");
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(setjmp(this->jerr.setjmp_buffer))
|
if(setjmp(this->jerr.setjmp_buffer))
|
||||||
{
|
{
|
||||||
@@ -1955,9 +1951,9 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf,
|
|||||||
|| t==NULL || flags<0)
|
|| t==NULL || flags<0)
|
||||||
_throw("tjTransform(): Invalid argument");
|
_throw("tjTransform(): Invalid argument");
|
||||||
|
|
||||||
if(flags&TJFLAG_FORCEMMX) setenv("JSIMD_FORCEMMX", "1", 1);
|
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||||
else if(flags&TJFLAG_FORCESSE) setenv("JSIMD_FORCESSE", "1", 1);
|
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||||
else if(flags&TJFLAG_FORCESSE2) setenv("JSIMD_FORCESSE2", "1", 1);
|
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||||
|
|
||||||
if(setjmp(this->jerr.setjmp_buffer))
|
if(setjmp(this->jerr.setjmp_buffer))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user