discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Compiler preprocessor defines


From: Ed Criscuolo
Subject: Re: [Discuss-gnuradio] Compiler preprocessor defines
Date: Mon, 03 Nov 2008 15:46:56 -0500
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Eric Blossom wrote:
On Mon, Nov 03, 2008 at 02:16:10PM -0500, Ed Criscuolo wrote:
Is there any preprocessor define (or defines) that can be used
when compiling C++ GnuRadio code to differentiate between
different OSs?  I've looked through config.h but didn't see
anything obvious.  I need to compile two different pieces
of code for OSX vs LINUX.


FWIW, the "autoconf way" is to test for features, not OS's.
In any event, if you look through config/*.m4 directory you'll find
all sorts of examples.

See also the autoconf manual.

What are you trying to conditionalize?


The tun/tap pseudo device is implemented very differently
on OSX vs LINUX, UNIX, et al.

Under LINUX et al, you open a single character device, usually
located at /dev/net/tun.  Then, you use ioctl's to to select
the pseudo network device name (tun0, tun1, tap0, tap1, etc) and
set the type (tun vs tap). There's also an option for requesting
a name with the next available number (ie - tun%d or tap%d).

Under OSX, the tun/tap driver precreates the character devices
/dev/tun0 thru /dev/tun15 and /dev/tap0 thru /dev/tap15.  The
application opens the appropriate character device to create the
associated pseudo network device of the same name and type.


@(^.^)@  Ed






reply via email to

[Prev in Thread] Current Thread [Next in Thread]