[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing New Macros
From: |
Eric Blake |
Subject: |
Re: Writing New Macros |
Date: |
Tue, 10 Apr 2007 06:13:38 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Lemings on 4/9/2007 1:32 PM:
> 2. An Autoconf macro that checks whether a given type is a built-in
> type or not. This macro is similar to AC_CHECK_TYPE except that it
> performs action-if-built-in only if the type is a built-in type and
> action-if-not-built-in if the type is not defined or not a built-in
> type.
> (Possibly the same as _AC_TYPE_CHECK_NEW without any includes at all.)
Don't use undocumented autoconf internals (unless you are writing a patch
for autoconf itself). The _AC namespace is reserved, and should not
appear in your configure.ac.
But what's wrong with AC_CHECK_TYPE([int], [action-if-builtin],
[action-if-not], [])? In other words, explicitly tell AC_CHECK_TYPE to
use no includes.
>
> 3. An Autoconf macro that defines a preprocessor name with the
> fundamental type as an existing type definition.
>
> FOO_REDEFINE_TYPE(FOO_INT8_T, int8_t, AC_INCLUDES_DEFAULT)
>
> and the type __sys_int8_t is defined in <sys/types.h> as
>
> typedef char __sys_int8_t int8_t;
Typo, I hope.
Why are you doing this? Avoiding header files seems like overkill; if
they are there and they work, use them. Meanwhile, based on your mention
of int8_t, you may be interested in the gnulib stdint module, which
provides a good example of how to build a header that provides all of the
[u]int{8,16,32}_t types and friends using autoconf.
http://www.gnu.org/software/gnulib/MODULES.html#module=stdint
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGG39w84KuGfSFAYARAvutAJ48RnbUVeLAONZ6NfdCZc+Fi4mxwQCfQWIZ
Mryv/zQgdZ1GYP5tmmKsh6o=
=nLH0
-----END PGP SIGNATURE-----
- Writing New Macros, Eric Lemings, 2007/04/09
- Re: Writing New Macros, Ralf Wildenhues, 2007/04/10
- Re: Writing New Macros,
Eric Blake <=
- RE: Writing New Macros, Eric Lemings, 2007/04/10
- Re: Writing New Macros, Eric Blake, 2007/04/10
- Re: Writing New Macros, Eric Blake, 2007/04/10
- RE: Writing New Macros, Eric Lemings, 2007/04/10
- RE: Writing New Macros, Benoit Sigoure, 2007/04/11
- RE: Writing New Macros, Keith MARSHALL, 2007/04/11