georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
838 stars 110 forks source link

serialize.c: fix for Darwin PPC #122

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago

There is no byteswap.h on macOS, respective functions are defined in libkern headers. Implement a fix similar to what was done for xrootd earlier: https://github.com/macports/macports-ports/commit/ec6af9d37037d2821d255b74f131648daff866e5 (merged to upstream since then too).

barracuda156 commented 1 year ago

@georgmartius If there is some specific reason not to use OS implementation for double, we can drop that line and move one #endif.

georgmartius commented 1 year ago

Hi, Well, I cannot remember this code very well. I have no idea why there is a custom implementation for double. I would not change it, unless we are very sure, though.

barracuda156 commented 1 year ago

Hi,

Well, I cannot remember this code very well. I have no idea why there is a custom implementation for double. I would not change it, unless we are very sure, though.

@georgmartius Thank you for responding. Proposed changes affect only Darwin PPC (which is broken at the moment), no other platforms. My thought was that some non-Apple systems may not have bswap64 in that header, hence explicit implementation for it (and Apple case was not considered). But this is a guess.

Is there a way to ensure it does the same? If yes, OS implementation should be preferred. Otherwise I can keep the custom one for all Big endian, since it does not rely on non-existent headers, and presumably gonna work on Apple as well.

georgmartius commented 1 year ago

I suggest I merge your version now, as I have no time to test alternatives etc. Even though it is not that pretty, that we have different implementations for differerent platforms.

barracuda156 commented 1 year ago

Thank you!