[ENet-discuss] [CMake] Autotools replacement functions?
Lee Salzman
lsalzman1 at cox.net
Wed Oct 15 19:02:32 PDT 2008
Actually, scratch that suggestion. Maybe something like:
#ifdef MSG_MAXIOVLEN
#define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN
#endif
If MSG_MAXIOVLEN is not defined, then ENET_BUFFER_MAXIMUM needs to be left
undefined. In theory this should handle that, presuming the platform
only defines
MSG_MAXIOVLEN via a preprocessor macro - since I don't think any
platform really
does otherwise. This can be put somewhere in enet/unix.h
Lee
Lee Salzman wrote:
> You can try just doing: #define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN
>
> Lee
>
> Andrew Fenn wrote:
>> Thanks, this was really helpful. I am now just stuck on this function..
>>
>> AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h,
>> AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
>>
>> I need something to search through an include file "socket.h", find
>> MSG_MAXIOVLEN and return true or false.
>>
>> I've been searching but I couldn't find anything.
>>
>> Regards,
>> Andrew
>>
>> On Wed, Oct 15, 2008 at 2:41 PM, Christian Ehrlicher
>> <Ch.Ehrlicher at gmx.de> wrote:
>>
>>>> Von: "Eric Noulard"
>>>> 2008/10/15 Andrew Fenn
>>>>
>>>>> Does cmake have replacement functions for the following?
>>>>>
>>>>> AC_CHECK_MEMBER(struct msghdr.msg_flags,
>>>>> [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include <sys/socket.h>])
>>>>>
>>>>> CHECK_FUNCTION_EXISTS(socklen_t HAS_SOCKLEN_T)
>>>>> AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], ,
>>>>> #include <sys/types.h>
>>>>> #include <sys/socket.h>
>>>>> )
>>>>>
>>>>> AC_EGREP_HEADER(MSG_MAXIOVLEN, /usr/include/sys/socket.h,
>>>>> AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
>>>>> AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h,
>>>>> AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
>>>>>
>>>> May be you can look at:
>>>> http://www.cmake.org/Wiki/CMake:How_To_Write_Platform_Checks
>>>>
>>>> CHECK_INCLUDE_FILES
>>>> CHECK_FUNCTION_EXISTS
>>>> CHECK_SYMBOL_EXISTS
>>>> CHECK_LIBRARY_EXISTS
>>>>
>>>> I did not find equivalent of
>>>> AC_CHECK_MEMBER
>>>>
>>>> but may be it exists and I don't know it.
>>>>
>>> KDE is using an own Macro for this:
>>> http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckStructMember.cmake
>>>
>>>
>>>
>>> Christian
>>> --
>>> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit
>>> Pastry Passion!
>>> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>>>
>>>
>>>
More information about the ENet-discuss
mailing list