-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DUMB 2.0 and DUMB 0.9.3 compatibility
We support two versions of DUMB to play tracked music: * 0.9.3 from Sourceforge <http://dumb.sourceforge.net> * 2.0.0 by kode54 on github <https://github.com/kode54/dumb> The DUMB homepage on Sourceforge endorses kode54's fork and links to it. The Allegro source tests the DUMB version and supports either API. Supported tracker formats in DUMB 2.0 that Allegro 5 can now play: * IT (Impulse Tracker) * XM (Fasttracker II) * MOD (Ultimate SoundTracker, ProTracker) * STM (Scream Tracker) * S3M (Scream Tracker 3) * 669 (Composer 669) * AMF (Asylum Music Format) * AMF (Digital Sound and Music Interface Advanced Music Format) * DSM (Digital Sound Interface Kit module format) * MTM (MultiTracker) * OKT (Oktalyzer) * PSM (Protracker Studio, both the older PSM16 and the newer PSM) * PTM (PolyTracker) * RIFF AM/AMFF (Galaxy Music System internal format) The CMake build script uses -lm on all platforms for the compile test. Without -lm, cmake finds the include paths and libraries, can compile the test program, but couldn't link it on Arch Linux.
- Loading branch information
Showing
5 changed files
with
201 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a problem building Allegro with DUMB 2.0 on my machine that runs Ubuntu 16.04 32-bit. I get this error:
/usr/local/include/dumb.h:121:1: error: static assertion failed: "fuse: off_t must be 64bit"
I found this comment in the DUMB source code:
Seems like the issue should be easy enough to fix, but I'm not sure how implementing one of these solutions might affect the rest of Allegro (option 1). DUMB has an issue with option 2 at the moment due to them having the syntax for
typedef
reversed.5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried option 1, and it appears to work fine (although you have to define it in quite a few files since we include dumb.h in an internal header). We already use
#define _FILE_OFFSET_BITS 64
in a few spots, so in principle things should be fine. I tested it with DUMB 0.9.3, and everything seemed to be okay (as it should be, as that version doesn't use off_t).5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn’t we just define
_FILE_OFFSET_BITS
in one place (the internal header you mentioned, where dumb.h is included)? I don’t understand why we’d have to define it in multiple places, that doesn’t sound very nice for maintenance...5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 1 sounds reasonable if A5 has
#define _FILE_OFFSET_BITS 64
already elsewhere. I'll leave it to you where to put it, one central place sounds nice.kode54 fixed it upstream within the last hour: kode54/dumb#66
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rondom found a bug in my patch (the Allegro 5 diff above), too.
These
#ifndef
s should be#if (DUMB_MAJOR_VERSION) < 2
. Reason:dumb_off_t
is not a macro, it is a typedef. The preprocessor will always believe this is not defined, and therefore replace too much.PR for this: #839
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fatcerberus, that's just a C/C++ thing. The internal header isn't included first in those files, so putting the define there wouldn't work unless you also changed a few more things. I'll see what the cleanest option ends up being.
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant though, is since the #define is only needed for dumb.h (correct me if I'm wrong), then it should be enough to do this regardless of include order:
Allegro doesn't need the define itself, right?
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, that define acts on some system headers that we also include before <dumb.h> (I think stdio.h?)
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that makes more sense then, sorry for being stupid :)
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine now as of dfbef0e.
5e2ac76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allegro will probably release during 2017-10 before TINS 2017 with SiegeLord's fix for option 1 under the hood -- defining
_FILE_OFFSET_BITS 64
in a private header.DUMB 2.0.2 got tagged 2 days ago, with the correct line
typedef DUMB_OFF_T_CUSTOM dumb_off_t;
and Rondom's better platform/compiler-checking code to define a 64-bit offset.I hope everything will turn out fine now!