I’m working on a cross platform project on which I need endian.h. But this file is not on Windows or Mac OS X.
Is there any way I can get it to work without the file, or is there a way to get the file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
endian.h is not cross-platform. It is very clearly marked as such: “These functions are nonstandard.”
You don’t need endian.h. What you need is some of the functionality that that header provides. All three of Windows, Linux, and Mac (and Solaris, and others) do provide native to big endian functions, and they use the near-standard names
htons,ntohl, etc. Will these suit your needs? If so, use them. They are portable. If not, you’ll have to, well, roll your own. It’s not hard. Or look to Boost. It probably has exactly what you want.