"Fossies" - the Fresh Open Source Software Archive

Member "scalpel-2.0/tre-0.7.5-win32/m4/ax_decl_wchar_max.m4" (20 Apr 2011, 1280 Bytes) of archive /linux/misc/scalpel-2.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl @synopsis AX_DECL_WCHAR_MAX
    2 dnl
    3 dnl Checks whether the system headers define WCHAR_MAX or not.  If it is
    4 dnl already defined, does nothing.  Otherwise checks the size and signedness
    5 dnl of `wchar_t', and defines WCHAR_MAX to the maximum value that can be
    6 dnl stored in a variable of type `wchar_t'.
    7 dnl
    8 dnl @version 1.1
    9 dnl @author Ville Laurikari <vl@iki.fi>
   10 dnl
   11 AC_DEFUN([AX_DECL_WCHAR_MAX], [
   12   AC_CACHE_CHECK([whether WCHAR_MAX is defined], ax_cv_decl_wchar_max, [
   13     AC_COMPILE_IFELSE(
   14       [AC_LANG_PROGRAM([
   15 #ifdef HAVE_WCHAR_H
   16 #include <wchar.h>
   17 #endif
   18 ], [WCHAR_MAX])],
   19       [ax_cv_decl_wchar_max="yes"],
   20       [ax_cv_decl_wchar_max="no"])])
   21   if test $ax_cv_decl_wchar_max = "no"; then
   22     AX_CHECK_SIGN([wchar_t],
   23       [ wc_signed="yes"
   24         AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
   25       [ wc_signed="no"
   26         AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned])], [
   27 #ifdef HAVE_WCHAR_H
   28 #include <wchar.h>
   29 #endif
   30 ])
   31     if test "$wc_signed" = "yes"; then
   32       AC_DEFINE(WCHAR_MAX, [(1L << (sizeof(wchar_t) * 8 - 1) - 1)], [
   33 Define to the maximum value of wchar_t if not already defined elsewhere])
   34     elif test "$wc_signed" = "no"; then
   35       AC_DEFINE(WCHAR_MAX, [(1L << (sizeof(wchar_t) * 8) - 1)])
   36     fi
   37   fi
   38 ])dnl