From Jean-Sebastien Guay, build fixes for Mingw
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
#this file is automatically generated
|
||||
|
||||
OPTION(CURL_IS_STATIC "on if curl is a static lib " ON)
|
||||
MARK_AS_ADVANCED(CURL_IS_STATIC)
|
||||
|
||||
IF(WIN32)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT")
|
||||
IF(CURL_IS_STATIC)
|
||||
ADD_DEFINITIONS(-DCURL_STATICLIB)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm wldap32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(ZLIB_FOUND)
|
||||
@@ -19,7 +13,7 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
|
||||
SET(TARGET_SRC
|
||||
SET(TARGET_SRC
|
||||
ReaderWriterCURL.cpp
|
||||
)
|
||||
|
||||
@@ -28,11 +22,17 @@ SET(TARGET_H
|
||||
)
|
||||
|
||||
IF(ZLIB_FOUND)
|
||||
SET(TARGET_LIBRARIES_VARS CURL_LIBRARY ZLIB_LIBRARY)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY} ${ZLIB_LIBRARY})
|
||||
ELSE()
|
||||
SET(TARGET_LIBRARIES_VARS CURL_LIBRARY )
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${CURL_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32 OR MINGW)
|
||||
IF(CURL_IS_STATIC)
|
||||
ADD_DEFINITIONS(-DCURL_STATICLIB)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32 winmm wldap32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_PLUGIN(curl)
|
||||
|
||||
@@ -70,6 +70,14 @@ namespace osgDBJPEG
|
||||
|
||||
static int jpegerror = ERR_NO_ERROR;
|
||||
|
||||
/* Some versions of jmorecfg.h define boolean, some don't...
|
||||
Those that do also define HAVE_BOOLEAN, so we can guard using that. */
|
||||
#ifndef HAVE_BOOLEAN
|
||||
typedef int boolean;
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/* CODE FOR READING/WRITING JPEG FROM STREAMS
|
||||
* This code was taken directly from jdatasrc.c and jdatadst.c (libjpeg source)
|
||||
* and modified to use a std::istream/ostream* instead of a FILE*
|
||||
|
||||
@@ -178,7 +178,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
endinfo = png_create_info_struct(png);
|
||||
|
||||
fin.read((char*)header,8);
|
||||
if (fin.gcount() == 8 && png_check_sig(header, 8))
|
||||
if (fin.gcount() == 8 && png_sig_cmp(header, 0, 8) == 0)
|
||||
png_set_read_fn(png,&fin,png_read_istream); //Use custom read function that will get data from istream
|
||||
else
|
||||
{
|
||||
@@ -229,7 +229,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
if (color == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_palette_to_rgb(png);
|
||||
if (color == PNG_COLOR_TYPE_GRAY && depth < 8)
|
||||
png_set_gray_1_2_4_to_8(png);
|
||||
png_set_expand_gray_1_2_4_to_8(png);
|
||||
if (png_get_valid(png, info, PNG_INFO_tRNS))
|
||||
png_set_tRNS_to_alpha(png);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user