zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

swprintf.inl (1299B) - Raw


      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 
      7 #ifndef _INC_SWPRINTF_INL
      8 #define _INC_SWPRINTF_INL
      9 
     10 #include <vadefs.h>
     11 
     12 #ifdef __cplusplus
     13 
     14 extern "C++" {
     15 
     16 __mingw_ovr
     17 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
     18 int vswprintf (wchar_t *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
     19 {
     20   return _vswprintf( __stream, __format, __local_argv );
     21 }
     22 
     23 __mingw_ovr
     24 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
     25 int swprintf (wchar_t *__stream, const wchar_t *__format, ...)
     26 {
     27 #ifdef __clang__
     28   /* clang does not support __builtin_va_arg_pack(), so forward swprintf() to vswprintf() */
     29   int __retval;
     30   __builtin_va_list __local_argv;
     31 
     32   __builtin_va_start( __local_argv, __format );
     33   __retval = vswprintf( __stream, __format, __local_argv );
     34   __builtin_va_end( __local_argv );
     35   return __retval;
     36 #else
     37   return _swprintf( __stream, __format, __builtin_va_arg_pack() );
     38 #endif
     39 }
     40 
     41 }
     42 
     43 #elif defined(_CRT_NON_CONFORMING_SWPRINTFS)
     44 
     45 #define swprintf _swprintf
     46 #define vswprintf _vswprintf
     47 
     48 #endif /* __cplusplus */
     49 
     50 #endif /* _INC_SWPRINTF_INL */