Fix linux build errors.

This commit is contained in:
castano 2010-11-02 01:03:19 +00:00
parent 5ae77ae037
commit ea42b83573
3 changed files with 6 additions and 14 deletions

View File

@ -35,6 +35,10 @@
# include <signal.h>
#endif
#if NV_OS_LINUX || NV_OS_DARWIN
# include <unistd.h> // getpid
#endif
#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
# include <execinfo.h> // backtrace
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
@ -43,7 +47,6 @@
#endif
#if NV_OS_DARWIN || NV_OS_FREEBSD
# include <unistd.h> // getpid
# include <sys/types.h>
# include <sys/sysctl.h> // sysctl
# include <sys/ucontext.h>

View File

@ -45,8 +45,6 @@ namespace nv
if( m_fp != NULL && m_autoclose ) {
#if NV_OS_WIN32
_fclose_nolock( m_fp );
#elif NV_OS_LINUX
fclose_unlocked( m_fp );
#else
fclose( m_fp );
#endif
@ -62,8 +60,6 @@ namespace nv
nvDebugCheck(pos <= size());
#if NV_OS_WIN32
_fseek_nolock(m_fp, pos, SEEK_SET);
#elif NV_OS_LINUX
fseek_unlocked(m_fp, pos, SEEK_SET);
#else
fseek(m_fp, pos, SEEK_SET);
#endif
@ -74,8 +70,6 @@ namespace nv
nvDebugCheck(m_fp != NULL);
#if NV_OS_WIN32
return _ftell_nolock(m_fp);
#elif NV_OS_LINUX
return ftell_unlocked(m_fp);
#else
return ftell(m_fp);
#endif
@ -89,11 +83,6 @@ namespace nv
_fseek_nolock(m_fp, 0, SEEK_END);
uint end = _ftell_nolock(m_fp);
_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
uint pos = ftell(m_fp);
fseek(m_fp, 0, SEEK_END);

View File

@ -1471,7 +1471,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s)
fimage->allocate(spp, width, height);
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++)
{
@ -1508,7 +1508,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s)
}
}
nv::mem::free(buf);
free(buf);
TIFFClose(tif);