Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add darwin support to NDB. #1465

Merged
merged 1 commit into from Jan 18, 2021
Merged

Conversation

rb2k
Copy link
Contributor

@rb2k rb2k commented Dec 21, 2020

This seems to do the trick for getting NDB to compile on macOS.
We've been running this patch in production for a bit and it hasn't caused any issues for us.

Feedback welcome, My C is very very rusty, so there might be better ways of doing this :)

@mlschroe
Copy link
Contributor

Is there really no header file that defines htole32()/le32toh()? And if that's not the case wouldn't

#define htole32(x) OSSwapHostToLittleInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)

be cleaner?

@rb2k
Copy link
Contributor Author

rb2k commented Dec 22, 2020

@mlschroe ah yes, that makes sense. I added it in the same ifdef __APPLE__ block as the endian.h. Not sure if there's a cleaner way.

I don't think there's a header with those two functions on darwin, at least I see references to that in e.g. https://lists.denx.de/pipermail/u-boot/2014-October/192892.html and patches like https://cgit.freedesktop.org/xcb/util-cursor/commit/?id=f03cc278c6cce0cf721adf9c3764d3c5fba63392

@pmatilai pmatilai merged commit 70f2a02 into rpm-software-management:master Jan 18, 2021
@pmatilai
Copy link
Member

Thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants