Closed Clownacy closed 1 year ago
converted the codebase to C89 (which only required changing some comments and eliminating the use of
__FUNCTION__
/__func__
,
__func__
is not C89 though: it is C99. Users of old compilers will hit failures with that.
I think you misunderstood: I converted the codebase to C89 by removing the uses of __func__
(and __FUNCTION__
).
In a different project, I have something like this. Maybe we should do something like that??
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __thisfunc__ __func__
#elif defined(__GNUC__) && __GNUC__ < 3
#define __thisfunc__ __FUNCTION__
#elif defined(__GNUC__) && __GNUC__ > 2
#define __thisfunc__ __func__
#elif defined(__WATCOMC__)
#define __thisfunc__ __FUNCTION__
#elif defined(__LCC__)
#define __thisfunc__ __func__
#elif defined(_MSC_VER) && _MSC_VER >= 1300 /* VC7++ */
#define __thisfunc__ __FUNCTION__
#else /* stupid fallback */
/*#define __thisfunc__ __FILE__*/
#error __func__ or __FUNCTION__ compiler token not supported? define one...
#endif
@psi29a: What do you think?
@psi29a: What do you think?
PING @psi29a ?
Picked and applied the MUS drums channel, constification, and C++-style comment patches.
Looking at the rest: will probably apply the stdio file_io patch later;
probably won't apply the __FUNCTION__
patch.
Hello, I'm back. I've also had to do something like https://github.com/Mindwerks/wildmidi/pull/240#issuecomment-1352049419 in another project as well.
We should also have "that" conversation if we want to support older compilers?
There are conflicts in this as well :)
There are conflicts in this as well :)
Conflicts are there because I hand-picked and applied some of the patches from the patchset.
Alright, then this can be closed or are there other bits that need to be done?
Alright, then this can be closed or are there other bits that need to be done?
I'll be looking at the stdio file-io patch (https://github.com/Mindwerks/wildmidi/pull/240/commits/9addc7d5ab42f2d68ea86debba589b460e2ada87). Maybe will apply maybe not.
The stdio file-io patch is in with small edits.
Closing the pull request. Thanks.
I've fixed #234, made the user-supplied input buffers
const
, added a standard C fallback to the file IO, and converted the codebase to C89 (which only required changing some comments and eliminating the use of__FUNCTION__
/__func__
, as the codebase was already mostly written in C89).