~ubuntu-branches/ubuntu/precise/parted/precise

« back to all changes in this revision

Viewing changes to gnulib/m4/mbswidth.m4

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2010-02-06 16:39:19 UTC
  • mfrom: (1.1.5 upstream)
  • mto: (7.3.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 48.
  • Revision ID: james.westby@ubuntu.com-20100206163919-nsxr2vtchk0ecabf
Tags: upstream-2.1
ImportĀ upstreamĀ versionĀ 2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# mbswidth.m4 serial 14
2
 
dnl Copyright (C) 2000-2002, 2004, 2006, 2007 Free Software Foundation, Inc.
3
 
dnl This file is free software; the Free Software Foundation
4
 
dnl gives unlimited permission to copy and/or distribute it,
5
 
dnl with or without modifications, as long as this notice is preserved.
6
 
 
7
 
dnl autoconf tests required for use of mbswidth.c
8
 
dnl From Bruno Haible.
9
 
 
10
 
AC_DEFUN([gl_MBSWIDTH],
11
 
[
12
 
  AC_CHECK_HEADERS_ONCE([wchar.h])
13
 
  AC_CHECK_FUNCS_ONCE([isascii mbsinit])
14
 
  gl_FUNC_MBRTOWC
15
 
 
16
 
  dnl UnixWare 7.1.1 <wchar.h> has a declaration of a function mbswidth()
17
 
  dnl that clashes with ours.
18
 
  AC_CACHE_CHECK([whether mbswidth is declared in <wchar.h>],
19
 
    ac_cv_have_decl_mbswidth,
20
 
    [AC_TRY_COMPILE([
21
 
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22
 
   <wchar.h>.
23
 
   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
24
 
   before <wchar.h>.  */
25
 
#include <stddef.h>
26
 
#include <stdio.h>
27
 
#include <time.h>
28
 
#include <wchar.h>
29
 
], [
30
 
  char *p = (char *) mbswidth;
31
 
  return !p;
32
 
], ac_cv_have_decl_mbswidth=yes, ac_cv_have_decl_mbswidth=no)])
33
 
  if test $ac_cv_have_decl_mbswidth = yes; then
34
 
    ac_val=1
35
 
  else
36
 
    ac_val=0
37
 
  fi
38
 
  AC_DEFINE_UNQUOTED(HAVE_DECL_MBSWIDTH_IN_WCHAR_H, $ac_val,
39
 
    [Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0 otherwise.])
40
 
 
41
 
  AC_TYPE_MBSTATE_T
42
 
])