root/maint/gnulib/lib/monetary.in.h

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* Wrapper around <monetary.h>.
   2    Copyright (C) 2017-2021 Free Software Foundation, Inc.
   3 
   4    This file is free software: you can redistribute it and/or modify
   5    it under the terms of the GNU Lesser General Public License as
   6    published by the Free Software Foundation; either version 2.1 of the
   7    License, or (at your option) any later version.
   8 
   9    This file is distributed in the hope that it will be useful,
  10    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12    GNU Lesser General Public License for more details.
  13 
  14    You should have received a copy of the GNU Lesser General Public License
  15    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
  16 
  17 #ifndef _@GUARD_PREFIX@_MONETARY_H
  18 
  19 #if __GNUC__ >= 3
  20 @PRAGMA_SYSTEM_HEADER@
  21 #endif
  22 @PRAGMA_COLUMNS@
  23 
  24 /* The include_next requires a split double-inclusion guard.  */
  25 #if @HAVE_MONETARY_H@
  26 # @INCLUDE_NEXT@ @NEXT_MONETARY_H@
  27 #endif
  28 
  29 #ifndef _@GUARD_PREFIX@_MONETARY_H
  30 #define _@GUARD_PREFIX@_MONETARY_H
  31 
  32 #if @GNULIB_STRFMON_L@
  33 # if @HAVE_XLOCALE_H@
  34 /* Get locale_t on Mac OS X 10.12.  */
  35 #  include <xlocale.h>
  36 # endif
  37 /* Get locale_t on glibc 2.5.  */
  38 # include <locale.h>
  39 #endif
  40 
  41 /* Like in <stdio.h>.  */
  42 #ifndef _GL_ATTRIBUTE_FORMAT
  43 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
  44 #  define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
  45 # else
  46 #  define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
  47 # endif
  48 #endif
  49 
  50 /* _GL_ATTRIBUTE_FORMAT_STRFMON
  51    indicates to GCC that the function takes a format string and arguments,
  52    where the format string directives are the ones standardized by ISO C99
  53    and POSIX.  */
  54 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
  55 # define _GL_ATTRIBUTE_FORMAT_STRFMON(formatstring_parameter, first_argument) \
  56    _GL_ATTRIBUTE_FORMAT ((__gnu_strfmon__, formatstring_parameter, first_argument))
  57 #elif __GNUC__ >= 3
  58 # define _GL_ATTRIBUTE_FORMAT_STRFMON(formatstring_parameter, first_argument) \
  59    _GL_ATTRIBUTE_FORMAT ((__strfmon__, formatstring_parameter, first_argument))
  60 #else
  61 # define _GL_ATTRIBUTE_FORMAT_STRFMON(formatstring_parameter, first_argument) /* empty */
  62 #endif
  63 
  64 
  65 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
  66 
  67 /* The definition of _GL_ARG_NONNULL is copied here.  */
  68 
  69 /* The definition of _GL_WARN_ON_USE is copied here.  */
  70 
  71 #ifdef __cplusplus
  72 extern "C" {
  73 #endif
  74 
  75 
  76 #if @GNULIB_STRFMON_L@
  77 /* Converts a monetary value to a string.
  78    See the POSIX:2008 specification
  79    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon_l.html.  */
  80 # if @REPLACE_STRFMON_L@
  81 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  82 #   define strfmon_l rpl_strfmon_l
  83 #  endif
  84 _GL_FUNCDECL_RPL (strfmon_l, ssize_t,
  85                   (char *restrict s, size_t maxsize, locale_t locale,
  86                    const char *restrict format, ...)
  87                   _GL_ATTRIBUTE_FORMAT_STRFMON (4, 5)
  88                   _GL_ARG_NONNULL ((4)));
  89 _GL_CXXALIAS_RPL (strfmon_l, ssize_t,
  90                   (char *restrict s, size_t maxsize, locale_t locale,
  91                    const char *restrict format, ...));
  92 # else
  93 #  if @HAVE_STRFMON_L@
  94 _GL_CXXALIAS_SYS (strfmon_l, ssize_t,
  95                   (char *restrict s, size_t maxsize, locale_t locale,
  96                    const char *restrict format, ...));
  97 #  endif
  98 # endif
  99 # if __GLIBC__ >= 2
 100 _GL_CXXALIASWARN (strfmon_l);
 101 # endif
 102 #elif defined GNULIB_POSIXCHECK
 103 # undef strfmon_l
 104 # if HAVE_RAW_DECL_STRFMON_L
 105 _GL_WARN_ON_USE (strfmon_l, "strfmon_l is buggy on older glibc systems - "
 106                  "use gnulib module chown for portability");
 107 # endif
 108 #endif
 109 
 110 
 111 #ifdef __cplusplus
 112 }
 113 #endif
 114 
 115 #endif /* _@GUARD_PREFIX@_MONETARY_H */
 116 #endif /* _@GUARD_PREFIX@_MONETARY_H */

/* [previous][next][first][last][top][bottom][index][help] */