Re: tgmath.h errors using openssl
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Dec 3, 2009, at 0:06, Benjamin Stiglitz wrote: >> A while back it was argued on this list that the best way to handle functions such as round etc with CGFloat by importing tgmath.h, which contains macros that automatically choose the correct version for the functions based on the size of its arguments. However, when I do this I get errors. The errors come with including files from openssl, in particular rsa.h, which is included through evp.h. The errors say: >> >> /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:100:0 /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:100: error: expected ')' before '__extension__' >> >> /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:100:0 /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:100: error: expected ';', ',' or ')' before 'RSA' >> >> /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:101:0 /Developer/SDKs/MacOSX10.5.sdk/usr/include/openssl/rsa.h:101: error: expected ';' before 'int' >> >> Even though the file does not contain an __extension__ (my guess is that this is included through another macro, which these C libraries are full of). >> >> Is this is a know incompatibility/bug? And is there a workaround? And if not, what would be the recommended way to use functions for CGFloat? > > Are you #including tgmath after openssl? > > -Ben No, I #import it in the precompile header, so in particular before openssl. I've worked around the problem by using CommonCrypto and doing base64 fully in code. If anyone knows of another library that can do base64 encode/decode which is compatible with tgmath I'd be interested. Christiaan