swprintf.inl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_SWPRINTF_INL
  7. #define _INC_SWPRINTF_INL
  8. #include <vadefs.h>
  9. #undef __mingw_ovr
  10. #if defined (__GNUC__)
  11. #define __mingw_ovr static __attribute__ ((__unused__)) __inline__ __cdecl
  12. #ifdef __mingw_static_ovr
  13. #undef __mingw_static_ovr
  14. #define __mingw_static_ovr __mingw_ovr
  15. #endif
  16. #elif defined(__cplusplus)
  17. #define __mingw_ovr inline __cdecl
  18. #else
  19. #define __mingw_ovr static __cdecl
  20. #endif
  21. __mingw_ovr
  22. /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
  23. int vswprintf (wchar_t *__stream, size_t __count, const wchar_t *__format, __builtin_va_list __local_argv)
  24. {
  25. return vsnwprintf( __stream, __count, __format, __local_argv );
  26. }
  27. __mingw_ovr
  28. /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
  29. int swprintf (wchar_t *__stream, size_t __count, const wchar_t *__format, ...)
  30. {
  31. int __retval;
  32. __builtin_va_list __local_argv;
  33. __builtin_va_start( __local_argv, __format );
  34. __retval = vswprintf( __stream, __count, __format, __local_argv );
  35. __builtin_va_end( __local_argv );
  36. return __retval;
  37. }
  38. #ifdef __cplusplus
  39. extern "C++" {
  40. __mingw_ovr
  41. /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
  42. int vswprintf (wchar_t *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
  43. {
  44. #if __USE_MINGW_ANSI_STDIO
  45. return __mingw_vswprintf( __stream, __format, __local_argv );
  46. #else
  47. return _vswprintf( __stream, __format, __local_argv );
  48. #endif
  49. }
  50. __mingw_ovr
  51. /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
  52. int swprintf (wchar_t *__stream, const wchar_t *__format, ...)
  53. {
  54. int __retval;
  55. __builtin_va_list __local_argv;
  56. __builtin_va_start( __local_argv, __format );
  57. __retval = vswprintf( __stream, __format, __local_argv );
  58. __builtin_va_end( __local_argv );
  59. return __retval;
  60. }
  61. }
  62. #elif defined(_CRT_NON_CONFORMING_SWPRINTFS)
  63. #if __USE_MINGW_ANSI_STDIO
  64. #define swprintf __mingw_swprintf
  65. #define vswprintf __mingw_vswprintf
  66. #else
  67. #define swprintf _swprintf
  68. #define vswprintf _vswprintf
  69. #endif
  70. #endif /* __cplusplus */
  71. #endif /* _INC_SWPRINTF_INL */