Fix linux build errors.
This commit is contained in:
parent
5ae77ae037
commit
ea42b83573
@ -35,6 +35,10 @@
|
|||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if NV_OS_LINUX || NV_OS_DARWIN
|
||||||
|
# include <unistd.h> // getpid
|
||||||
|
#endif
|
||||||
|
|
||||||
#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
|
#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
|
||||||
# include <execinfo.h> // backtrace
|
# include <execinfo.h> // backtrace
|
||||||
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
|
||||||
@ -43,7 +47,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NV_OS_DARWIN || NV_OS_FREEBSD
|
#if NV_OS_DARWIN || NV_OS_FREEBSD
|
||||||
# include <unistd.h> // getpid
|
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/sysctl.h> // sysctl
|
# include <sys/sysctl.h> // sysctl
|
||||||
# include <sys/ucontext.h>
|
# include <sys/ucontext.h>
|
||||||
|
@ -45,8 +45,6 @@ namespace nv
|
|||||||
if( m_fp != NULL && m_autoclose ) {
|
if( m_fp != NULL && m_autoclose ) {
|
||||||
#if NV_OS_WIN32
|
#if NV_OS_WIN32
|
||||||
_fclose_nolock( m_fp );
|
_fclose_nolock( m_fp );
|
||||||
#elif NV_OS_LINUX
|
|
||||||
fclose_unlocked( m_fp );
|
|
||||||
#else
|
#else
|
||||||
fclose( m_fp );
|
fclose( m_fp );
|
||||||
#endif
|
#endif
|
||||||
@ -62,8 +60,6 @@ namespace nv
|
|||||||
nvDebugCheck(pos <= size());
|
nvDebugCheck(pos <= size());
|
||||||
#if NV_OS_WIN32
|
#if NV_OS_WIN32
|
||||||
_fseek_nolock(m_fp, pos, SEEK_SET);
|
_fseek_nolock(m_fp, pos, SEEK_SET);
|
||||||
#elif NV_OS_LINUX
|
|
||||||
fseek_unlocked(m_fp, pos, SEEK_SET);
|
|
||||||
#else
|
#else
|
||||||
fseek(m_fp, pos, SEEK_SET);
|
fseek(m_fp, pos, SEEK_SET);
|
||||||
#endif
|
#endif
|
||||||
@ -74,8 +70,6 @@ namespace nv
|
|||||||
nvDebugCheck(m_fp != NULL);
|
nvDebugCheck(m_fp != NULL);
|
||||||
#if NV_OS_WIN32
|
#if NV_OS_WIN32
|
||||||
return _ftell_nolock(m_fp);
|
return _ftell_nolock(m_fp);
|
||||||
#elif NV_OS_LINUX
|
|
||||||
return ftell_unlocked(m_fp);
|
|
||||||
#else
|
#else
|
||||||
return ftell(m_fp);
|
return ftell(m_fp);
|
||||||
#endif
|
#endif
|
||||||
@ -89,11 +83,6 @@ namespace nv
|
|||||||
_fseek_nolock(m_fp, 0, SEEK_END);
|
_fseek_nolock(m_fp, 0, SEEK_END);
|
||||||
uint end = _ftell_nolock(m_fp);
|
uint end = _ftell_nolock(m_fp);
|
||||||
_fseek_nolock(m_fp, pos, SEEK_SET);
|
_fseek_nolock(m_fp, pos, SEEK_SET);
|
||||||
#elif NV_OS_LINUX
|
|
||||||
uint pos = ftell_unlocked(m_fp);
|
|
||||||
fseek_unlocked(m_fp, 0, SEEK_END);
|
|
||||||
uint end = ftell_unlocked(m_fp);
|
|
||||||
fseek_unlocked(m_fp, pos, SEEK_SET);
|
|
||||||
#else
|
#else
|
||||||
uint pos = ftell(m_fp);
|
uint pos = ftell(m_fp);
|
||||||
fseek(m_fp, 0, SEEK_END);
|
fseek(m_fp, 0, SEEK_END);
|
||||||
|
@ -1471,7 +1471,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s)
|
|||||||
fimage->allocate(spp, width, height);
|
fimage->allocate(spp, width, height);
|
||||||
|
|
||||||
int linesize = TIFFScanlineSize(tif);
|
int linesize = TIFFScanlineSize(tif);
|
||||||
tdata_t buf = (::uint8 *)nv::mem::malloc(linesize);
|
tdata_t buf = malloc<uint8>(linesize);
|
||||||
|
|
||||||
for (uint y = 0; y < height; y++)
|
for (uint y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
@ -1508,7 +1508,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nv::mem::free(buf);
|
free(buf);
|
||||||
|
|
||||||
TIFFClose(tif);
|
TIFFClose(tif);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user