Mindwerks / wildmidi

WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
https://github.com/Mindwerks/wildmidi
Other
201 stars 41 forks source link

AMIGAOS4: Fix compiler error with Seek() #228

Closed raziel- closed 3 years ago

raziel- commented 3 years ago

Seek() is a dos.library function and deprecated in favour of ChangeFilePosition().

In the latest SDK the obsolete status has been forced by changing the name to OBSOLETESeek().

A proper fix would be to rewrite to use the fseek()/lseek() pair or aforementioned ChangeFilePosition().

A quick workaround is to

include <dos/obsolete.h>

into

ifdef amigaos4

to compile a working binary again.

Which it does and which I propose.

Thank you

sezero commented 3 years ago

Thanks.

sezero commented 3 years ago

Where can I download the latest os4 sdk so that I can build-test stuff?

https://www.hyperion-entertainment.com/index.php/downloads?view=files&parent=30 lists SDK_53.30.lha as the latest from 2015, and it doesn't seem to define Seek as OBSOLETESeek, unless I'm missing something?

raziel- commented 3 years ago

@sezero

53.30 is indeed the latest. And in include/include_h/dos/obsolete.h you'll find define seek(a, b, c) OBSOLETEseek(a, b, c) at line 217

sezero commented 3 years ago

Just downloaded it, and did lha x SDK_53.30.lha and lha x SDK_Install/base.lha I don't see that definition. What am I doing wrong?

raziel- commented 3 years ago

Not sure just did the same as you and all the directories get uncrunched fine.

My sdk.lha has a size of 90.260.327 bytes

sezero commented 3 years ago

My sdk.lha has a size of 90.260.327 bytes

Same here

raziel- commented 3 years ago

Try this: lha x SDK_Install/base.lha SDK_Install/base/

sezero commented 3 years ago

Try this: lha x SDK_Install/base.lha SDK_Install/base/

I'm not bure what that would achieve, but that did nothing for me, i.e. nothing extracted (For the record: I'm on linux, not on amiga.)

raziel- commented 3 years ago

It would be sent to it's own directory without cluttering up your current dir.

Seems lha is not working for you then. You could try lha e as last resort or I could send you the whole pack as zip, if you want

sezero commented 3 years ago

Seems lha is not working for you then.

For that particular command line, seems so.

If you think that the extracted files are somehow corrupted, I tried extracting with 7z and got the same result. Are you sure that you don't have local modifications to headers??

$ ls -l dos/*
-rw-rw-r--. 1 sezero sezero 12078 Aug 10  2015 dos/anchorpath.h
-rw-rw-r--. 1 sezero sezero  2823 Aug 10  2015 dos/datetime.h
-rw-rw-r--. 1 sezero sezero  1655 Aug 10  2015 dos/dosasl.h
-rw-rw-r--. 1 sezero sezero 52424 Aug 10  2015 dos/dosextens.h
-rw-rw-r--. 1 sezero sezero 30864 Aug 10  2015 dos/dos.h
-rw-rw-r--. 1 sezero sezero   726 Aug 10  2015 dos/doshunks.h
-rw-rw-r--. 1 sezero sezero 33755 Aug 10  2015 dos/dostags.h
-rw-rw-r--. 1 sezero sezero  6812 Aug 10  2015 dos/errors.h
-rw-rw-r--. 1 sezero sezero  2860 Aug 10  2015 dos/exall.h
-rw-rw-r--. 1 sezero sezero 26892 Aug 10  2015 dos/filehandler.h
-rw-rw-r--. 1 sezero sezero  5171 Aug 10  2015 dos/mount.h
-rw-rw-r--. 1 sezero sezero  5712 Aug 10  2015 dos/notify.h
-rw-rw-r--. 1 sezero sezero 14958 Aug 10  2015 dos/obsolete.h
-rw-rw-r--. 1 sezero sezero  2005 Aug 10  2015 dos/path.h
-rw-rw-r--. 1 sezero sezero  4845 Aug 10  2015 dos/rdargs.h
-rw-rw-r--. 1 sezero sezero  2296 Aug 10  2015 dos/record.h
-rw-rw-r--. 1 sezero sezero  5549 Aug 10  2015 dos/startup.h
-rw-rw-r--. 1 sezero sezero  1900 Aug 10  2015 dos/stdio.h
-rw-rw-r--. 1 sezero sezero  5172 Aug 10  2015 dos/var.h

I could send you the whole pack as zip, if you want

That wouldn't hurt.

raziel- commented 3 years ago

I only have the GCC release updated, everything else is the same as it is in 53.30.

I'll pack it up and send it to you. Email or cloud somewhere?

sezero commented 3 years ago

Email should be fine (sezeroz at gmail com)

raziel- commented 3 years ago

On it

raziel- commented 3 years ago

Sent with sprend...hope that's ok

sezero commented 3 years ago

Got the zip, thanks.

I grep'ed case-insensitively through the whole contents of the zip, binaries included, I found no references to an OBSOLETEseek at all.

I also ran diff between mine and your version of the headers, found no differences either.

raziel- commented 3 years ago

But have you decrunched it and looked for the actual file?

I dont know anything about linux, but i know that the file with that specific define is there.

raziel- commented 3 years ago

And I see that you have obsolete.h in your list you posted. Just open the file in a text editor and go to line 217

sezero commented 3 years ago

But have you decrunched it and looked for the actual file?

Really..

OK, I'll bite: yes I did exactly that

I dont know anything about linux, but i know that the file with that specific define is there.

No it is not

And I see that you have obsolete.h in your list you posted. Just open the file in a text editor and go to line 217

Lines 213 to 220 in include_h/dos/obsolete.h are:

/*********************/
/* Obsolete macros   */

/* 
**  This assumes a BCPL pointer always has the two most significant bits cleared.
**  Unfortunately, this will only be true with 32 bit addressing.
*/
#define IS_VALID_BPTR(bptr)   ((((uint32)(bptr)) & 0xC0000000) == 0)
raziel- commented 3 years ago

Uhh...you will hate me now

There was an sdk update (part of update 2 for the OS) i completely forget about, let me just quickly pack it up

Sorry :-(

sezero commented 3 years ago

OK :)