RE: Writing New Macros

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

 



 

> -----Original Message-----
> From: Eric Blake [mailto:ebb9@xxxxxxx] 
> Sent: Tuesday, April 10, 2007 6:14 AM
> To: Eric Lemings
> Cc: autoconf@xxxxxxx
> Subject: Re: Writing New Macros
> 
> -----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.

It wouldn't.  I'm writing custom M4 macros that would appear in the
configure.ac and calls to the reserved _AC namespace would appear in
these custom macros.  Nothing wrong with that right?  :P

> 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.

Just as good.  :)

> > 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

Thanks for the link.

The reason for writing such macros is that in some environments these
headers are not available (e.g. embedded software) or should not be
available (e.g. when writing the standard library itself).  Very
uncommon situations.

Eric.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux