[1.5] Fix compilation issue with Compiler Borland C++ v. 5.5

Fixes issue 154
This commit is contained in:
Mathieu Malaterre 2012-07-11 15:07:05 +00:00
parent 6b5bbc2645
commit a74a41b932
2 changed files with 9 additions and 2 deletions

View File

@ -152,7 +152,7 @@ unsigned char cio_bytein(opj_cio_t *cio) {
* v : value to write * v : value to write
* n : number of bytes to write * n : number of bytes to write
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned long long int v, int n) { unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n) {
int i; int i;
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) ) if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )

View File

@ -31,6 +31,13 @@
#ifndef __CIO_H #ifndef __CIO_H
#define __CIO_H #define __CIO_H
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define int64 __int64
#else
#define int64 long long
#endif
/** /**
@file cio.h @file cio.h
@brief Implementation of a byte input-output process (CIO) @brief Implementation of a byte input-output process (CIO)
@ -63,7 +70,7 @@ Write some bytes
@param n Number of bytes to write @param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occured @return Returns the number of bytes written or 0 if an error occured
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned long long int v, int n); unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n);
/** /**
Read some bytes Read some bytes
@param cio CIO handle @param cio CIO handle