diff options
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/CMakeLists.txt | 14 | ||||
| -rw-r--r-- | indra/llimage/llimagejpeg.cpp | 11 | ||||
| -rw-r--r-- | indra/llimage/llimagejpeg.h | 4 |
3 files changed, 21 insertions, 8 deletions
diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index cc75c463bc..3abc85954b 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -8,9 +8,13 @@ include(LLImage) include(JPEG) include(LLKDU) include(ZLIBNG) +if (LL_TESTS) include(LLAddBuildTest) +endif () include(bugsplat) +if (LL_TESTS) include(Tut) +endif () set(llimage_SOURCE_FILES llimagebmp.cpp @@ -63,6 +67,16 @@ target_link_libraries(llimage ll::libjpeg ) +if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set_source_files_properties(llimageworker.cpp PROPERTIES COMPILE_FLAGS -Wno-int-in-bool-context) + set_source_files_properties( + llimage.cpp + llimagefilter.cpp + PROPERTIES COMPILE_FLAGS -Wno-stringop-overflow) +endif() + +include(LibraryInstall) + # Add tests if (LL_TESTS) SET(llimage_TEST_SOURCE_FILES diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index ab6c593fc2..803d8f17fc 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -31,7 +31,7 @@ #include "llerror.h" #include "llexception.h" -#if !LL_ARM64 +#if !(LL_DARWIN && defined(__arm64__)) jmp_buf LLImageJPEG::sSetjmpBuffer ; #endif LLImageJPEG::LLImageJPEG(S32 quality) @@ -80,9 +80,8 @@ bool LLImageJPEG::updateData() // //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao - //except in the case of AARCH64/ARM64 where setjmp will crash // -#if !LL_ARM64 +#if !(LL_DARWIN && defined(__arm64__)) if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); @@ -228,7 +227,7 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // -#if !LL_ARM64 +#if !(LL_DARWIN && defined(__arm64__)) if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); @@ -438,8 +437,8 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo ) // Let the memory manager delete any temp files jpeg_destroy(cinfo); -#if !LL_ARM64 // Return control to the setjmp point +#if !(LL_DARWIN && defined(__arm64__)) longjmp(sSetjmpBuffer, 1) ; #endif } @@ -559,7 +558,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // -#if !LL_ARM64 +#if !(LL_DARWIN && defined(__arm64__)) if( setjmp(sSetjmpBuffer) ) { // If we get here, the JPEG code has signaled an error. diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index ee0a8815e8..920f712fba 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -32,7 +32,7 @@ #include "llimage.h" extern "C" { -#ifdef LL_USESYSTEMLIBS +#if 1 # include <jpeglib.h> # include <jerror.h> #else @@ -78,7 +78,7 @@ protected: S32 mEncodeQuality; // on a scale from 1 to 100 private: -#if !LL_ARM64 +#if !(LL_DARWIN && defined(__arm64__)) static jmp_buf sSetjmpBuffer; // To allow the library to abort. #endif }; |
