Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
- Subject: Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
- From: Graeme Mathieson <email@hidden>
- Date: Wed, 18 May 2005 15:41:05 +0100
On 18 May 2005, at 15:16, james tittle wrote:
I ask because it turns out that sqrtf and friends are now defined
in /usr/local/architecture/ppc/math.h, but they weren't in >10.4...
The Single Unix Specification[1] defines sqrtf() and friends as being
available as a result of #including <math.h>. You shouldn't need to
root around and include the actual header file it winds up being
defined in; this breaks portability as you've discovered. :-)
Tested on 10.4:
mathie@Tandoori:misc$ cat foo.c
#include <stdio.h>
#include <math.h>
int main(void) {
printf("Square root of 8 is: %f\n", sqrtf(8.0));
return 0;
}
mathie@Tandoori:misc$ make foo
cc foo.c -o foo
mathie@Tandoori:misc$ ./foo
Square root of 8 is: 2.828427
[1] http://www.unix.org/single_unix_specification/ - need to register
for access.
--
Mail: email@hidden | Web: http://woss.name/
AIM: Math1e | PGP: 1024D/D72F2737
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden