5
* $Id: pformat.h,v 1.1 2008/07/28 23:24:20 keithmarshall Exp $
7
* A private header, defining the `pformat' API; it is to be included
8
* in each compilation unit implementing any of the `printf' family of
9
* functions, but serves no useful purpose elsewhere.
11
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
13
* This is free software. You may redistribute and/or modify it as you
14
* see fit, without restriction of copyright.
16
* This software is provided "as is", in the hope that it may be useful,
17
* but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
18
* MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no
19
* time will the author accept any form of liability for any damages,
20
* however caused, resulting from the use of this software.
24
/* The following macros reproduce definitions from _mingw.h,
25
* so that compilation will not choke, if using any compiler
26
* other than the MinGW implementation of GCC.
30
# define __cdecl __attribute__((__cdecl__))
36
#ifndef __MINGW_GNUC_PREREQ
37
# if defined __GNUC__ && defined __GNUC_MINOR__
38
# define __MINGW_GNUC_PREREQ( major, minor )\
39
(__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
41
# define __MINGW_GNUC_PREREQ( major, minor )
45
#ifndef __MINGW_NOTHROW
46
# if __MINGW_GNUC_PREREQ( 3, 3 )
47
# define __MINGW_NOTHROW __attribute__((__nothrow__))
49
# define __MINGW_NOTHROW
53
/* The following are the declarations specific to the `pformat' API...
55
#define PFORMAT_TO_FILE 0x1000
56
#define PFORMAT_NOLIMIT 0x2000
58
#if defined(__MINGW32__) || defined(__MINGW64__)
60
* Map MinGW specific function names, for use in place of the generic
61
* implementation defined equivalent function names.
63
# define __pformat __mingw_pformat
65
# define __printf __mingw_printf
66
# define __fprintf __mingw_fprintf
67
# define __sprintf __mingw_sprintf
68
# define __snprintf __mingw_snprintf
70
# define __vprintf __mingw_vprintf
71
# define __vfprintf __mingw_vfprintf
72
# define __vsprintf __mingw_vsprintf
73
# define __vsnprintf __mingw_vsnprintf
77
int __cdecl __pformat( int, void *, int, const char *, va_list ) __MINGW_NOTHROW;
79
#endif /* !defined PFORMAT_H */