~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ros-privexp/mingw-w64-crt/stdio/mingw_pformat.h

  • Committer: NightStrike
  • Date: 2010-08-11 22:20:57 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:3266
Branch for adding option for supporting ros

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PFORMAT_H
 
2
/*
 
3
 * pformat.h
 
4
 *
 
5
 * $Id: pformat.h,v 1.1 2008/07/28 23:24:20 keithmarshall Exp $
 
6
 *
 
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.
 
10
 *
 
11
 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
 
12
 *
 
13
 * This is free software.  You may redistribute and/or modify it as you
 
14
 * see fit, without restriction of copyright.
 
15
 *
 
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.
 
21
 */
 
22
#define PFORMAT_H
 
23
 
 
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.
 
27
 */
 
28
#ifndef __cdecl
 
29
# ifdef __GNUC__
 
30
#  define __cdecl __attribute__((__cdecl__))
 
31
# else
 
32
#  define __cdecl
 
33
# endif
 
34
#endif
 
35
 
 
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)))
 
40
# else
 
41
#  define __MINGW_GNUC_PREREQ( major, minor )
 
42
# endif
 
43
#endif
 
44
 
 
45
#ifndef  __MINGW_NOTHROW
 
46
# if __MINGW_GNUC_PREREQ( 3, 3 )
 
47
#  define __MINGW_NOTHROW  __attribute__((__nothrow__))
 
48
# else
 
49
#  define __MINGW_NOTHROW
 
50
# endif
 
51
#endif
 
52
 
 
53
/* The following are the declarations specific to the `pformat' API...
 
54
 */
 
55
#define PFORMAT_TO_FILE     0x1000
 
56
#define PFORMAT_NOLIMIT     0x2000
 
57
 
 
58
#if defined(__MINGW32__) || defined(__MINGW64__)
 
59
 /*
 
60
  * Map MinGW specific function names, for use in place of the generic
 
61
  * implementation defined equivalent function names.
 
62
  */
 
63
# define __pformat        __mingw_pformat
 
64
 
 
65
# define __printf         __mingw_printf
 
66
# define __fprintf        __mingw_fprintf
 
67
# define __sprintf        __mingw_sprintf
 
68
# define __snprintf       __mingw_snprintf
 
69
 
 
70
# define __vprintf        __mingw_vprintf
 
71
# define __vfprintf       __mingw_vfprintf
 
72
# define __vsprintf       __mingw_vsprintf
 
73
# define __vsnprintf      __mingw_vsnprintf
 
74
 
 
75
#endif
 
76
 
 
77
int __cdecl __pformat( int, void *, int, const char *, va_list ) __MINGW_NOTHROW;
 
78
 
 
79
#endif /* !defined PFORMAT_H */