shithub: aacdec

Download patch

ref: 544ab69bfab3f755851ec071a4687a4942436345
parent: 19834178b65d4b28d731c6abffbcfe8c38594afe
author: menno <menno>
date: Sun Oct 19 15:28:41 EDT 2003

__int64 fix

--- a/common/mp4ff/atom.c
+++ b/common/mp4ff/atom.c
@@ -100,9 +100,9 @@
 	return (long)result;
 }
 
-unsigned __int64 mp4ff_atom_read_size64(char *data)
+uint64_t mp4ff_atom_read_size64(char *data)
 {
-	unsigned __int64 result = 0;
+	uint64_t result = 0;
 	int i;
 
 	for (i = 0; i < 8; i++) {
--- a/common/mp4ff/funcprotos.h
+++ b/common/mp4ff/funcprotos.h
@@ -3,7 +3,7 @@
 
 /* atom handling routines */
 long mp4ff_atom_read_size(char *data);
-unsigned __int64 mp4ff_atom_read_size64(char *data);
+uint64_t mp4ff_atom_read_size64(char *data);
 int mp4ff_atom_write_header(mp4ff_t *file, mp4ff_atom_t *atom, char *text);
 int mp4ff_atom_read_header(mp4ff_t *file, mp4ff_atom_t *atom);
 int mp4ff_atom_write_footer(mp4ff_t *file, mp4ff_atom_t *atom);
@@ -82,8 +82,8 @@
 int mp4ff_write_fixed32(mp4ff_t *file, float number);
 float mp4ff_read_fixed16(mp4ff_t *file);
 int mp4ff_write_fixed16(mp4ff_t *file, float number);
-unsigned __int64 mp4ff_read_int64(mp4ff_t *file);
-int mp4ff_write_int64(mp4ff_t *file, unsigned __int64 number);
+uint64_t mp4ff_read_int64(mp4ff_t *file);
+int mp4ff_write_int64(mp4ff_t *file, uint64_t number);
 long mp4ff_read_int32(mp4ff_t *file);
 int mp4ff_write_int32(mp4ff_t *file, long number);
 long mp4ff_read_int24(mp4ff_t *file);
--- a/common/mp4ff/private.h
+++ b/common/mp4ff/private.h
@@ -6,6 +6,22 @@
 #define HEADER_LENGTH 8
 #define MAXTRACKS 1024
 
+#ifdef _WIN32
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#define u_int64_t uint64_t
+#endif
+
+#endif
+
+
 typedef struct
 {
 	float values[9];
@@ -438,9 +454,9 @@
 {
     size_t (*read)(void *buffer, size_t length);
     size_t (*write)(void *buffer, size_t length);
-    __int64 (*get_position)();
-    __int64 (*get_length)();
-    int (*seek)(__int64 position);
+    int64_t (*get_position)();
+    int64_t (*get_length)();
+    int (*seek)(int64_t position);
 } mp4_callback_t;
 
 typedef struct
--- a/common/mp4ff/util.c
+++ b/common/mp4ff/util.c
@@ -88,7 +88,7 @@
 	return mp4ff_write_data(file, data, 4);
 }
 
-int mp4ff_write_int64(mp4ff_t *file, unsigned __int64 value)
+int mp4ff_write_int64(mp4ff_t *file, uint64_t value)
 {
 	unsigned char data[8];
 	int i;
@@ -140,16 +140,16 @@
 	return mp4ff_write_data(file, data, 2);
 }
 
-unsigned __int64 mp4ff_read_int64(mp4ff_t *file)
+uint64_t mp4ff_read_int64(mp4ff_t *file)
 {
 	unsigned char data[8];
-	unsigned __int64 result = 0;
+	uint64_t result = 0;
 	int i;
 
 	mp4ff_read_data(file, data, 8);
 
 	for (i = 0; i < 8; i++) {
-		result |= ((unsigned __int64)data[i]) << ((7 - i) * 8);
+		result |= ((uint64_t)data[i]) << ((7 - i) * 8);
 	}
 
 	return result;
--- a/common/mp4ff/vmhd.c
+++ b/common/mp4ff/vmhd.c
@@ -51,7 +51,7 @@
 	mp4ff_write_char(file, vmhd->version);
 	mp4ff_write_int24(file, vmhd->flags);
 
-	mp4ff_write_int64(file, (unsigned __int64)0);
+	mp4ff_write_int64(file, (uint64_t)0);
 
 	mp4ff_atom_write_footer(file, &atom);
 }