Mac OS X version at compile-time
Mac OS X version at compile-time
- Subject: Mac OS X version at compile-time
- From: Peter Lovell <email@hidden>
- Date: Wed, 6 Oct 2004 18:23:38 -0400
Does anyone know of a convenient way to determine at compile-time (C
preprocessor time, actually) which version of headers are being used? I
know there are macros in "AvailabilityMacros.h" but that's not
applicable to the problem I have.
I'm trying to adapt an open-source project for Max OS X. This will then
be built by various developers as needed, on varying OSs and versions.
Most of this is OK but I ran into a problem with a change to
<sys/socket.h>
In early versions, there is not typedef for "socklen_t". But in OS X
10.2 and later, there is this definition ...
/*
* Data types.
*/
typedef u_char sa_family_t;
#ifdef _BSD_SOCKLEN_T_
typedef _BSD_SOCKLEN_T_ socklen_t;
#undef _BSD_SOCKLEN_T_
#endif
So, my code which includes <sys/socket.h> cannot determine whether it
is defined or not. I think an easy solution for this would have been to
add
#define SOCKLEN_T_DEFINED
in the block, but that opportunity has passed us by. The only way I can
see is to check the version of the headers being used.
So, is there a #define somewhere which I can test?? Or a more
appropriate solution?
Thanks.....Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden