[trunk] Fixed compilation error under Visual Studio 2003 (fixes issue 351)

This commit is contained in:
Matthieu Darbois 2014-12-09 05:44:55 +00:00
parent 04ace2a558
commit 776b83ddbc
2 changed files with 6 additions and 3 deletions

View File

@ -136,6 +136,10 @@ static INLINE long lrintf(float f){
} }
#endif #endif
#if defined(_MSC_VER) && (_MSC_VER < 1400)
#define vsnprintf _vsnprintf
#endif
#include "opj_inttypes.h" #include "opj_inttypes.h"
#include "opj_clock.h" #include "opj_clock.h"
#include "opj_malloc.h" #include "opj_malloc.h"

View File

@ -46,13 +46,12 @@
# define M_LOG10E 0.434294481903251827651 # define M_LOG10E 0.434294481903251827651
#endif #endif
// BorlandC 5.5 is broken on that // BorlandC 5.5 & Visual Studio 2003 are broken on that
#ifdef __BORLANDC__ #if defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER == 1310))
#define sinf(x) (float)sin((float)x) #define sinf(x) (float)sin((float)x)
#define sqrtf(x) (float)sqrt((float)x) #define sqrtf(x) (float)sqrt((float)x)
#endif #endif
// Alignment of ICC file format uses 4 bytes (cmsUInt32Number) // Alignment of ICC file format uses 4 bytes (cmsUInt32Number)
#define _cmsSIZEOFLONGMINUS1 (sizeof(cmsUInt32Number)-1) #define _cmsSIZEOFLONGMINUS1 (sizeof(cmsUInt32Number)-1)
#define _cmsALIGNLONG(x) (((x)+_cmsSIZEOFLONGMINUS1) & ~(_cmsSIZEOFLONGMINUS1)) #define _cmsALIGNLONG(x) (((x)+_cmsSIZEOFLONGMINUS1) & ~(_cmsSIZEOFLONGMINUS1))