Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / m4 / setlocale.m4
1 # setlocale.m4 serial 4 (gettext-0.18)
2 dnl Copyright (C) 2001-2002, 2006, 2009, 2015 Free Software Foundation,
3 dnl Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 # Check for setlocale declaration.
9
10 AC_DEFUN([gt_SETLOCALE],[
11 AC_MSG_CHECKING([for setlocale declaration])
12 AC_CACHE_VAL(gt_cv_proto_setlocale, [
13 AC_TRY_COMPILE([
14 #include <stdlib.h>
15 #include <locale.h>
16 extern
17 #ifdef __cplusplus
18 "C"
19 #endif
20 #if defined(__STDC__) || defined(__cplusplus)
21 char *setlocale (int category, char *locale);
22 #else
23 char *setlocale();
24 #endif
25 ], [], gt_cv_proto_setlocale_arg1="", gt_cv_proto_setlocale_arg1="const")
26 gt_cv_proto_setlocale="extern char *setlocale (int category, $gt_cv_proto_setlocale_arg1 char *locale);"])
27 gt_cv_proto_setlocale=`echo "[$]gt_cv_proto_setlocale" | tr -s ' ' | sed -e 's/( /(/'`
28 AC_MSG_RESULT([
29          $gt_cv_proto_setlocale])
30 AC_DEFINE_UNQUOTED(SETLOCALE_CONST,$gt_cv_proto_setlocale_arg1,
31   [Define as const if the declaration of setlocale() needs const.])
32 ])