Opened 17 years ago

Closed 17 years ago

Last modified 6 years ago

#8737 closed patch (outdated)

TOOLS: Fixes to let them build on AmigaOS4

Reported by: (none) Owned by: fingolfin
Priority: normal Component: Port: AmigaOS4
Version: Keywords:
Cc: Game:

Description

Mostly typedef clashes and one wrong size(?)

Index: scummvm_tools/compress_scumm_bun.cpp

--- scummvm_tools/compress_scumm_bun.cpp (revision 29335) +++ scummvm_tools/compress_scumm_bun.cpp (working copy) @@ -763,7 +763,7 @@

typedef struct { int offset, size, codec; } CompTable;

-byte *decompressBundleSound(int index, FILE *input, int32 &finalSize) { +byte *decompressBundleSound(int index, FILE *input, int &finalSize) { byte compOutput[0x2000]; int i;

Index: scummvm_tools/extract_mm_nes.c

--- scummvm_tools/extract_mm_nes.c (revision 29335) +++ scummvm_tools/extract_mm_nes.c (working copy) @@ -23,7 +23,12 @@ #include "util.h" #include <stdarg.h>

+#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else typedef int BOOL; +#endif #define TRUE 1 #define FALSE 0

Index: scummvm_tools/util.h

--- scummvm_tools/util.h (revision 29335) +++ scummvm_tools/util.h (working copy) @@ -47,10 +47,16 @@ typedef unsigned char byte; typedef unsigned char uint8; typedef unsigned short uint16; -typedef unsigned int uint32; typedef signed char int8; typedef signed short int16; + +#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else +typedef unsigned int uint32; typedef signed int int32; +#endif

#if !defined(__cplusplus) typedef uint8 bool; Index: scummvm_tools/extract_zak_c64.c =================================================================== --- scummvm_tools/extract_zak_c64.c (revision 29335) +++ scummvm_tools/extract_zak_c64.c (working copy) @@ -23,7 +23,12 @@ #include "util.h" #include <stdarg.h>

+#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else typedef int BOOL; +#endif #define TRUE 1 #define FALSE 0

Index: scummvm_tools/extract_loom_tg16.c

--- scummvm_tools/extract_loom_tg16.c (revision 29335) +++ scummvm_tools/extract_loom_tg16.c (working copy) @@ -26,7 +26,12 @@ #include <string.h> #include "util.h"

+#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else typedef int BOOL; +#endif #define TRUE 1 #define FALSE 0

Index: scummvm_tools/extract_mm_c64.c

--- scummvm_tools/extract_mm_c64.c (revision 29335) +++ scummvm_tools/extract_mm_c64.c (working copy) @@ -23,7 +23,12 @@ #include "util.h" #include <stdarg.h>

+#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else typedef int BOOL; +#endif #define TRUE 1 #define FALSE 0

Index: scummvm_tools/extract_mm_apple.c

--- scummvm_tools/extract_mm_apple.c (revision 29335) +++ scummvm_tools/extract_mm_apple.c (working copy) @@ -23,7 +23,12 @@ #include "util.h" #include <stdarg.h>

+#ifdef __amigaos4__ +#include <exec/types.h> +#include <stdlib.h> +#else typedef int BOOL; +#endif #define TRUE 1 #define FALSE 0

Ticket imported from: #1823349. Ticket imported from: patches/842.

Change History (11)

comment:1 by bluegr, 17 years ago

Initial comments: * compress_scumm_bun.cpp: why did you change int32 to int? You removed the uint32 typedef from util.h, but why was this necessary in the first place? * util.h: I don't understand why the uint32 typedef is problematic in Amiga * extract_mm_nes.c, extract_zak_c64.c, extract_loom_tg16.c, extract_mm_c64.c, extract_mm_apple.c: they all look ok to me (your changes are Amiga specific)

comment:2 by (none), 17 years ago

[quote] * compress_scumm_bun.cpp: why did you change int32 to int? You removed the uint32 typedef from util.h, but why was this necessary in the first place? [/quote]

compress_scumm_bun.cpp: In function 'int main(int, char**)': compress_scumm_bun.cpp:1218: error: invalid initialization of reference of type 'int32&' from expression of type 'int' compress_scumm_bun.cpp:766: error: in passing argument 3 of 'byte* decompressBundleSound(int, FILE*, int32&)'

I'm sure there is a far better solution for this, but changing it to int worked for me, i know it might break on other platforms, but i'm a noob and need help :-)

[quote] * util.h: I don't understand why the uint32 typedef is problematic in Amiga [/quote]

Neither do i :-) Maybe the parts from amiga specific types.h explains?

[quote] /* Whenever possible, use these typesdefs instead of the traditional * BYTE/WORD/LONG. These are absolutely unambigious when it comes to * datatype and number of bits */

typedef unsigned char uint8; typedef signed char int8;

typedef unsigned short uint16; typedef signed short int16;

typedef unsigned long uint32; typedef signed long int32;

and

typedef uint8 UBYTE; typedef int8 BYTE; typedef uint8 BYTEBITS; typedef uint16 UWORD; typedef int16 WORD; typedef uint16 WORDBITS; typedef uint32 ULONG; typedef int32 LONG; typedef uint32 LONGBITS; typedef uint16 RPTR;

comment:3 by fingolfin, 17 years ago

Please, always *attach* this as a proper patch file. Posting patches in a comment makes them very difficult to apply and review properly.

comment:4 by fingolfin, 17 years ago

The changes here are now partially obsolete/outdated, as I just removed the unused "BOOL" typedef.

comment:5 by (none), 17 years ago

@fingolfin

Terribly sorry, will think of it the next time :-/

Thanks for the fixes so far

comment:6 by fingolfin, 17 years ago

Is there anything left here which has not yet been covered in the repository? If so, please attach it as a patch.

comment:7 by fingolfin, 17 years ago

Owner: set to fingolfin
Status: newpending

comment:8 by (none), 17 years ago

Sorry, was away at work

No building errors left, thanks a lot :-)

comment:9 by (none), 17 years ago

Status: pendingnew

comment:10 by fingolfin, 17 years ago

Resolution: outdated
Status: newclosed

comment:11 by digitall, 6 years ago

Component: Port: AmigaOS4
Note: See TracTickets for help on using tickets.