[1.5] Fix compilation issue with Compiler Borland C++ v. 5.5
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 11 Jul 2012 15:07:05 +0000 (15:07 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Wed, 11 Jul 2012 15:07:05 +0000 (15:07 +0000)
Fixes issue 154

libopenjpeg/cio.c
libopenjpeg/cio.h

index b8a7ecf8a873a7f4cf001e59334a98d4dc6ae383..c0cb02827b0a61841df627a53c83aa97645cb82d 100644 (file)
@@ -152,7 +152,7 @@ unsigned char cio_bytein(opj_cio_t *cio) {
  * v : value 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;
        for (i = n - 1; i >= 0; i--) {
                if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )
index ce1a13ecb3a5cab9ac1b8aaaaeab30e77e0420c5..e62743141ca6684f6a08469d240d1e48cc04e44f 100644 (file)
 
 #ifndef __CIO_H
 #define __CIO_H
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#define int64 __int64
+#else
+#define int64 long long
+#endif
+
 /**
 @file cio.h
 @brief Implementation of a byte input-output process (CIO)
@@ -63,7 +70,7 @@ Write some bytes
 @param n Number of bytes to write
 @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
 @param cio CIO handle