AC-Archive
Autoconf Macro Archive

ac-archive.sf.net: - Project CVS - Download
Macro Index
- AM Support
- C++ Support
- C Support
- Fortran Support
- Java Support
- Cross Compilation
- Installed Packages
- Miscellaneous
- LaTeX Support
- Uncategorized
- archive macros
- adl's macros
- bkorb's macros
- guidod's macros
- latex's macros
- other's macros
- rleigh's macros
- obsoleted macros
- released macros
- search index

Documentation
- Contribute!
- History
- acincludedir m4
- acinclude (tool)
- macro howto
- ax tricks
- maintainers
- License
- Topics

generated...
2007年08月05日

(C) 2007 guidod
Synopsis
AC_DEFINE_INTEGER_BITS (TYPE [, CANDIDATE-TYPE]...)
, 
Version

2002年01月31日

Author

Scott Pakin <pakin@uiuc.edu>

License

AllPermissive
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Users of this software should generally follow the principles of the MIT License includings its disclaimer.

Category

cryp.to ac-archive's Miscellaneous (released)

Documentation

Given a TYPE of the form "int##_t" or "uint##_t", see if the datatype TYPE is predefined. If not, then define TYPE -- both with AC_DEFINE and as a shell variable -- to the first datatype of exactly ## bits in a list of CANDIDATE-TYPEs. If none of the CANDIDATE-TYPEs contains exactly ## bits, then set the TYPE shell variable to "no".

For example, the following ensures that uint64_t is defined as a 64-bit datatype:

 AC_DEFINE_INTEGER_BITS(uint64_t, unsigned long long, unsigned __int64, long)
 if test "$uint64_t" = no; then
 AC_MSG_ERROR([unable to continue without a 64-bit datatype])
 fi

You should then put the following in your C code to ensure that all datatypes defined by AC_DEFINE_INTEGER_BITS are visible to your program:

 #include "config.h"
 #if HAVE_INTTYPES_H
 # include <inttypes.h>
 #else
 # if HAVE_STDINT_H
 # include <stdint.h>
 # endif
 #endif
M4 Source Code
AC_DEFUN([AC_DEFINE_INTEGER_BITS],
[m4_define([ac_datatype_bits], [m4_translit(1,ドル [a-zA-Z_])])
m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
AC_CHECK_TYPE(1,ドル ,
 [
 AC_MSG_NOTICE([trying to find a suitable ]ac_datatype_bytes[-byte replacement for 1ドル])
 1ドル=no
 find_1ドル ()
 {
 _AC_DEFINE_INTEGER_BITS_HELPER($@)
 :
 }
 find_1ドル
 AC_DEFINE_UNQUOTED(1,ドル $1,ドル
 [If not already defined, then define as a datatype of *exactly* ]ac_datatype_bits[ bits.])
 ])
])
dnl Iterate over arguments 2ドル..$N, trying to find a good match for 1ドル.
m4_define([_AC_DEFINE_INTEGER_BITS_HELPER],
[ifelse(2,ドル , ,
 [m4_define([ac_datatype_bits], [m4_translit(1,ドル [a-zA-Z_])])
 m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
 AC_CHECK_SIZEOF(2ドル)
 if test "$AS_TR_SH(ac_cv_sizeof_2ドル)" -eq ac_datatype_bytes; then
 1ドル="2ドル"
 return
 fi
 _AC_DEFINE_INTEGER_BITS_HELPER(1,ドル m4_shift(m4_shift($@)))
 ])
])

AltStyle によって変換されたページ (->オリジナル) /