locale.in.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* A POSIX <locale.h>.
  2. Copyright (C) 2007-2012 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef _@GUARD_PREFIX@_LOCALE_H
  14. #if __GNUC__ >= 3
  15. @PRAGMA_SYSTEM_HEADER@
  16. #endif
  17. @PRAGMA_COLUMNS@
  18. /* The include_next requires a split double-inclusion guard. */
  19. #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
  20. #ifndef _@GUARD_PREFIX@_LOCALE_H
  21. #define _@GUARD_PREFIX@_LOCALE_H
  22. /* NetBSD 5.0 mis-defines NULL. */
  23. #include <stddef.h>
  24. /* MacOS X 10.5 defines the locale_t type in <xlocale.h>. */
  25. #if @HAVE_XLOCALE_H@
  26. # include <xlocale.h>
  27. #endif
  28. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  29. /* The definition of _GL_ARG_NONNULL is copied here. */
  30. /* The definition of _GL_WARN_ON_USE is copied here. */
  31. /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
  32. On systems that don't define it, use the same value as GNU libintl. */
  33. #if !defined LC_MESSAGES
  34. # define LC_MESSAGES 1729
  35. #endif
  36. #if @GNULIB_SETLOCALE@
  37. # if @REPLACE_SETLOCALE@
  38. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  39. # undef setlocale
  40. # define setlocale rpl_setlocale
  41. # define GNULIB_defined_setlocale 1
  42. # endif
  43. _GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
  44. _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
  45. # else
  46. _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
  47. # endif
  48. _GL_CXXALIASWARN (setlocale);
  49. #elif defined GNULIB_POSIXCHECK
  50. # undef setlocale
  51. # if HAVE_RAW_DECL_SETLOCALE
  52. _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
  53. "use gnulib module setlocale for portability");
  54. # endif
  55. #endif
  56. #if @GNULIB_DUPLOCALE@
  57. # if @REPLACE_DUPLOCALE@
  58. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  59. # undef duplocale
  60. # define duplocale rpl_duplocale
  61. # endif
  62. _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
  63. _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
  64. # else
  65. # if @HAVE_DUPLOCALE@
  66. _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
  67. # endif
  68. # endif
  69. # if @HAVE_DUPLOCALE@
  70. _GL_CXXALIASWARN (duplocale);
  71. # endif
  72. #elif defined GNULIB_POSIXCHECK
  73. # undef duplocale
  74. # if HAVE_RAW_DECL_DUPLOCALE
  75. _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
  76. "use gnulib module duplocale for portability");
  77. # endif
  78. #endif
  79. #endif /* _@GUARD_PREFIX@_LOCALE_H */
  80. #endif /* _@GUARD_PREFIX@_LOCALE_H */