File: stdint.m4

package info (click to toggle)
cvs 2%3A1.12.13%2Breal-15%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 18,128 kB
  • ctags: 10,221
  • sloc: ansic: 100,318; sh: 33,775; asm: 3,281; perl: 2,818; ada: 1,681; makefile: 1,587; yacc: 1,184; pascal: 1,082; cpp: 1,001; lisp: 35
file content (58 lines) | stat: -rw-r--r-- 1,993 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# stdint.m4 serial 4
dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl From Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.

AC_DEFUN([gl_STDINT_H],
[dnl Check for <inttypes.h>.
AC_REQUIRE([gt_HEADER_INTTYPES_H])
dnl Check for <sys/inttypes.h>.
AC_CHECK_HEADERS([sys/inttypes.h])

AC_MSG_CHECKING([for stdint.h])
AC_CACHE_VAL(gl_cv_header_stdint_h, [
  AC_TRY_COMPILE([#include <stdint.h>], [],
    gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)])
AC_MSG_RESULT([$gl_cv_header_stdint_h])
if test $gl_cv_header_stdint_h = yes; then
  AC_DEFINE(HAVE_STDINT_H, 1,
            [Define if you have a working <stdint.h> header file.])
  STDINT_H=''
else
  STDINT_H='stdint.h'

  dnl Is long == int64_t ?
  AC_CACHE_CHECK([whether 'long' is 64 bit wide], gl_cv_long_bitsize_64, [
    AC_TRY_COMPILE([
#define POW63  ((((((long) 1 << 15) << 15) << 15) << 15) << 3)
#define POW64  ((((((long) 1 << 15) << 15) << 15) << 15) << 4)
typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1];
], , gl_cv_long_bitsize_64=yes, gl_cv_long_bitsize_64=no)])
  if test $gl_cv_long_bitsize_64 = yes; then
    HAVE_LONG_64BIT=1
  else
    HAVE_LONG_64BIT=0
  fi
  AC_SUBST(HAVE_LONG_64BIT)

  dnl Is long long == int64_t ?
  AC_CACHE_CHECK([whether 'long long' is 64 bit wide], gl_cv_longlong_bitsize_64, [
    AC_TRY_COMPILE([
#define POW63  ((((((long long) 1 << 15) << 15) << 15) << 15) << 3)
#define POW64  ((((((long long) 1 << 15) << 15) << 15) << 15) << 4)
typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1];
], , gl_cv_longlong_bitsize_64=yes, gl_cv_longlong_bitsize_64=no)])
  if test $gl_cv_longlong_bitsize_64 = yes; then
    HAVE_LONG_LONG_64BIT=1
  else
    HAVE_LONG_LONG_64BIT=0
  fi
  AC_SUBST(HAVE_LONG_LONG_64BIT)

fi
AC_SUBST(STDINT_H)
])