Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2012 15:30:14 +0000
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Alexander Leidinger <netchild@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r230509 - head/tools/kerneldoc/subsys
Message-ID:  <85825935-7581-4CDB-8D4F-DA5CF935492C@FreeBSD.org>
In-Reply-To: <201201241513.q0OFDtfM080661@svn.freebsd.org>
References:  <201201241513.q0OFDtfM080661@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24. Jan 2012, at 15:13 , Alexander Leidinger wrote:

> Author: netchild
> Date: Tue Jan 24 15:13:55 2012
> New Revision: 230509
> URL: http://svn.freebsd.org/changeset/base/230509
>=20
> Log:
>  Just define __FreeBSD__ to 1 instead of doing what the compiler does.
>  The kernel is supposed to DTRT based upon the __FreeBSD_version =
value,
>  not the value of __FreeBSD__.
>=20
>  Discussed with:	bz
>=20
> Modified:
>  head/tools/kerneldoc/subsys/common-Doxyfile
>=20
> Modified: head/tools/kerneldoc/subsys/common-Doxyfile
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/tools/kerneldoc/subsys/common-Doxyfile	Tue Jan 24 =
14:27:14 2012	(r230508)
> +++ head/tools/kerneldoc/subsys/common-Doxyfile	Tue Jan 24 =
15:13:55 2012	(r230509)
> @@ -230,8 +230,12 @@ SEARCH_INCLUDES        =3D YES
> INCLUDE_PATH           =3D $(DOXYGEN_SRC_INCLUDE_PATH) \
>                          .
> INCLUDE_FILE_PATTERNS  =3D *.h
> +# __FreeBSD__ is normally defined to the the major version number of
> +# FreeBSD. In the kernel source it is just checked for !=3D 0, and

That's not what it is and not what I said.  It's checked to be defined.  =
Defining
it to 0 or even nothing will still be perfectly ok.

Try cpp on this:

#define FOO
#ifdef FOO
#warning "It works"
#endif

#define BAR     0
#ifdef BAR
#warning "It still works"
#endif

#define BAZ     42
#ifdef BAZ
#warning "You guessed it. It still works"
#endif

#ifdef NOWAY
#warning "You shall never see this"
#endif

> +# __FreeBSD_version is used for version dependend code.
> +# To make live simple on major version bumps, just define __FreeBSD__ =
to 1.
> PREDEFINED             =3D _KERNEL \
> -                         __FreeBSD__=3D10 \
> +                         __FreeBSD__=3D1 \
>                          __${TARGET_ARCH}__=3D1 \
>                          __${TARGET_ARCH}=3D1
> EXPAND_AS_DEFINED      =3D=20

--=20
Bjoern A. Zeeb                                 You have to have visions!
   It does not matter how good you are. It matters what good you do!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?85825935-7581-4CDB-8D4F-DA5CF935492C>