Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Src/CmdLineParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ DAMAGE.
#include <string>
#include <vector>

#ifdef WIN32
#ifdef _WIN32
int strcasecmp( const char* c1 , const char* c2 );
#endif // WIN32
#endif // _WIN32

class cmdLineReadable
{
Expand Down
22 changes: 11 additions & 11 deletions Src/CmdLineParser.inl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ DAMAGE.
#include <cassert>
#include <string.h>

#if defined( WIN32 ) || defined( _WIN64 )
#if defined( _WIN32 ) || defined( _WIN64 )
inline int strcasecmp( const char* c1 , const char* c2 ){ return _stricmp( c1 , c2 ); }
#endif // WIN32 || _WIN64
#endif // _WIN32 || _WIN64

template< > void cmdLineCleanUp< int >( int* t ){ }
template< > void cmdLineCleanUp< float >( float* t ){ }
Expand All @@ -48,29 +48,29 @@ template< > void cmdLineWriteValue< char* >( char* t , char* str ){ if( t ) sp
template< > int cmdLineCopy( int t ){ return t; }
template< > float cmdLineCopy( float t ){ return t; }
template< > double cmdLineCopy( double t ){ return t; }
#if defined( WIN32 ) || defined( _WIN64 )
#if defined( _WIN32 ) || defined( _WIN64 )
template< > char* cmdLineCopy( char* t ){ return _strdup( t ); }
#else // !WIN32 && !_WIN64
#else // !_WIN32 && !_WIN64
template< > char* cmdLineCopy( char* t ){ return strdup( t ); }
#endif // WIN32 || _WIN64
#endif // _WIN32 || _WIN64
template< > int cmdLineStringToType( const char* str ){ return atoi( str ); }
template< > float cmdLineStringToType( const char* str ){ return float( atof( str ) ); }
template< > double cmdLineStringToType( const char* str ){ return double( atof( str ) ); }
#if defined( WIN32 ) || defined( _WIN64 )
#if defined( _WIN32 ) || defined( _WIN64 )
template< > char* cmdLineStringToType( const char* str ){ return _strdup( str ); }
#else // !WIN32 && !_WIN64
#else // !_WIN32 && !_WIN64
template< > char* cmdLineStringToType( const char* str ){ return strdup( str ); }
#endif // WIN32 || _WIN64
#endif // _WIN32 || _WIN64


/////////////////////
// cmdLineReadable //
/////////////////////
#if defined( WIN32 ) || defined( _WIN64 )
#if defined( _WIN32 ) || defined( _WIN64 )
inline cmdLineReadable::cmdLineReadable( const char *name ) : set(false) { this->name = _strdup( name ); }
#else // !WIN32 && !_WIN64
#else // !_WIN32 && !_WIN64
inline cmdLineReadable::cmdLineReadable( const char *name ) : set(false) { this->name = strdup( name ); }
#endif // WIN32 || _WIN64
#endif // _WIN32 || _WIN64

inline cmdLineReadable::~cmdLineReadable( void ){ if( name ) free( name ) ; name = NULL; }
inline int cmdLineReadable::read( char** , int ){ set = true ; return 0; }
Expand Down
30 changes: 15 additions & 15 deletions Src/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ struct FileNameParser

inline bool ImageReader::ValidExtension( const char *ext )
{
#ifdef WIN32
#ifdef _WIN32
if ( !_stricmp( ext , "jpeg" ) || !_stricmp( ext , "jpg" ) ) return true;
else if( !_stricmp( ext , "png" ) ) return true;
else if( !_stricmp( ext , "iGrid" ) ) return true;
#else // !WIN32
#else // !_WIN32
if( !strcasecmp( ext , "jpeg" ) || !strcasecmp( ext , "jpg" ) ) return true;
else if( !strcasecmp( ext , "png" ) ) return true;
else if( !strcasecmp( ext , "iGrid" ) ) return true;
#endif // WIN32
#endif // _WIN32
return false;
}

Expand All @@ -182,15 +182,15 @@ inline ImageReader* ImageReader::Get( const char* fileName )
unsigned int width , height , channels;
ImageReader* reader = NULL;
char* ext = FileNameParser::Extension( fileName );
#ifdef WIN32
#ifdef _WIN32
if ( !_stricmp( ext , "jpeg" ) || !_stricmp( ext , "jpg" ) ) reader = new JPEGReader( fileName , width , height , channels );
else if( !_stricmp( ext , "png" ) ) reader = new PNGReader( fileName , width , height , channels );
else if( !_stricmp( ext , "iGrid" ) ) reader = new TiledImageReader( fileName , width , height , channels );
#else // !WIN32
#else // !_WIN32
if( !strcasecmp( ext , "jpeg" ) || !strcasecmp( ext , "jpg" ) ) reader = new JPEGReader( fileName , width , height , channels );
else if( !strcasecmp( ext , "png" ) ) reader = new PNGReader( fileName , width , height , channels );
else if( !strcasecmp( ext , "iGrid" ) ) reader = new TiledImageReader( fileName , width , height , channels );
#endif // WIN32
#endif // _WIN32
else
{
delete[] ext;
Expand All @@ -206,53 +206,53 @@ inline ImageReader* ImageReader::Get( const char* fileName )
inline void ImageReader::GetInfo( const char* fileName , unsigned int& width , unsigned int& height , unsigned int& channels )
{
char* ext = FileNameParser::Extension( fileName );
#ifdef WIN32
#ifdef _WIN32
if( !_stricmp( ext , "jpeg" ) || !_stricmp( ext , "jpg" ) ) JPEGReader::GetInfo( fileName , width , height , channels );
else if( !_stricmp( ext , "png" ) ) PNGReader::GetInfo( fileName , width , height , channels );
else if( !_stricmp( ext , "iGrid" ) ) TiledImageReader::GetInfo( fileName , width , height , channels );
#else // !WIN32
#else // !_WIN32
if( !strcasecmp( ext , "jpeg" ) || !strcasecmp( ext , "jpg" ) ) JPEGReader::GetInfo( fileName , width , height , channels );
else if( !strcasecmp( ext , "png" ) ) PNGReader::GetInfo( fileName , width , height , channels );
else if( !strcasecmp( ext , "iGrid" ) ) TiledImageReader::GetInfo( fileName , width , height , channels );
#endif // WIN32
#endif // _WIN32
delete[] ext;
}

inline bool ImageWriter::ValidExtension( const char *ext )
{
#ifdef WIN32
#ifdef _WIN32
if( !_stricmp( ext , "jpeg" ) || !_stricmp( ext , "jpg" ) ) return true;
else if( !_stricmp( ext , "png" ) ) return true;
#ifdef SUPPORT_TILES
else if( !_stricmp( ext , "iGrid" ) ) return true;
#endif // SUPPORT_TILES
#else // !WIN32
#else // !_WIN32
if( !strcasecmp( ext , "jpeg" ) || !strcasecmp( ext , "jpg" ) ) return true;
else if( !strcasecmp( ext , "png" ) ) return true;
#ifdef SUPPORT_TILES
else if( !strcasecmp( ext , "iGrid" ) ) return true;
#endif // SUPPORT_TILES
#endif // WIN32
#endif // _WIN32
return false;
}

inline ImageWriter* ImageWriter::Get( const char* fileName , unsigned int width , unsigned int height , unsigned int channels , ImageWriterParams params )
{
ImageWriter* writer = NULL;
char* ext = FileNameParser::Extension( fileName );
#ifdef WIN32
#ifdef _WIN32
if( !_stricmp( ext , "jpeg" ) || !_stricmp( ext , "jpg" ) ) writer = new JPEGWriter( fileName , width , height , channels , params.quality );
else if( !_stricmp( ext , "png" ) ) writer = new PNGWriter( fileName , width , height , channels , params.quality );
#ifdef SUPPORT_TILES
else if( !_stricmp( ext , "iGrid" ) ) writer = new TiledImageWriter( fileName , width , height , channels , params );
#endif // SUPPORT_TILES
#else // !WIN32
#else // !_WIN32
if( !strcasecmp( ext , "jpeg" ) || !strcasecmp( ext , "jpg" ) ) writer = new JPEGWriter( fileName , width , height , channels , params.quality );
else if( !strcasecmp( ext , "png" ) ) writer = new PNGWriter( fileName , width , height , channels , params.quality );
#ifdef SUPPORT_TILES
else if( !strcasecmp( ext , "iGrid" ) ) writer = new TiledImageWriter( fileName , width , height , channels , params );
#endif // SUPPORT_TILES
#endif // WIN32
#endif // _WIN32
else
{
delete[] ext;
Expand Down
4 changes: 2 additions & 2 deletions Src/LinearSolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#ifdef USE_CHOLMOD
#include <Cholmod/cholmod.h>
#if defined( WIN32 ) || defined( _WIN64 )
#if defined( _WIN32 ) || defined( _WIN64 )
#pragma message( "[WARNING] Need to explicitly exclude VCOMP.lib" )
#pragma comment( lib , "CHOLMOD_FULL.lib" )
#endif // WIN32 || _WIN64
#endif // _WIN32 || _WIN64
#ifdef DLONG
typedef long long SOLVER_LONG;
#define CHOLMOD( name ) cholmod_l_ ## name
Expand Down
10 changes: 5 additions & 5 deletions Src/MyMiscellany.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ DAMAGE.
////////////////
#include <string.h>
#include <sys/timeb.h>
#ifndef WIN32
#ifndef _WIN32
#include <sys/time.h>
#endif // WIN32
#endif // _WIN32

inline double Time( void )
{
#ifdef WIN32
#ifdef _WIN32
struct _timeb t;
_ftime( &t );
return double( t.time ) + double( t.millitm ) / 1000.0;
#else // WIN32
#else // !_WIN32
struct timeval t;
gettimeofday( &t , NULL );
return t.tv_sec + double( t.tv_usec ) / 1000000;
#endif // WIN32
#endif // _WIN32
}

#include <cstdio>
Expand Down