mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
292 stars 19 forks source link

fix: clockid_t redefinition patch for osx 10.12 and later #97

Closed chenrui333 closed 1 year ago

chenrui333 commented 1 year ago
../types.h:90:13: error: typedef redefinition with different types ('int' vs 'enum clockid_t')
typedef int clockid_t;
            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/time.h:172:3: note: previous definition is here
} clockid_t;
  ^
1 error generated.

relates to https://github.com/Homebrew/homebrew-core/pull/123669

mywave82 commented 1 year ago

Which MacOS version are you using?

The #ifdef a bit further up guards that this code-block should only be included on MacOS 10.12 or earlier.

# if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12

I am guessing that on your system, the test above does not work as expected

Could you attempt to repair it so that i works on your system, and I can verify it mine too (which is very old)

mywave82 commented 1 year ago

I am guessing that this might be a issue that only present on the ARM version, and that it does not define MAC_OS_X_VERSION_10_12 ?

Would the fix be simply to replace

# if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12

with:

# ifndef MAC_OS_X_VERSION_10_12
#  define MAC_OS_X_VERSION_10_12 101200
# endif
# if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
mywave82 commented 1 year ago

Thank you for the heads up about the problem btw. Even if your patch was not accepted, it was very helpfull for tracking down the real problem.

Will see in the next release if the fix really works.

chenrui333 commented 1 year ago

yeah, totally, happy to help! :)