~ubuntu-branches/debian/sid/gsmartcontrol/sid

« back to all changes in this revision

Viewing changes to src/hz/string_sprintf_macros.h

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano
  • Date: 2011-07-15 14:59:29 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715145929-2o1o4phm5w1rwttz
Tags: 0.8.6-1
* [dbb993d] Updated my email address and removed DM-Upload-Allowed
  control field
* [b681b5b] Imported Upstream version 0.8.6
* [ab9bb7a] Refreshed patches
* [a909506] Bump to Standards-Version 3.9.2, no changes needed
* [48dd13d] Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************
 
2
 Copyright:
 
3
      (C) 2008 - 2011  Alexander Shaduri <ashaduri 'at' gmail.com>
 
4
 License: See LICENSE_zlib.txt file
 
5
***************************************************************************/
 
6
/// \file
 
7
/// \author Alexander Shaduri
 
8
/// \ingroup hz
 
9
/// \weakgroup hz
 
10
/// @{
 
11
 
 
12
#ifndef HZ_STRING_SPRINTF_MACROS_H
 
13
#define HZ_STRING_SPRINTF_MACROS_H
 
14
 
 
15
#include "hz_config.h"  // feature macros
 
16
 
 
17
#include "system_specific.h"  // HZ_FUNC_PRINTF_*_CHECK
 
18
 
 
19
 
 
20
// This is a helper file for string_sprintf.h. It is useful if you need
 
21
// the macros only, but not the implementation (useful for header files).
 
22
 
 
23
 
 
24
 
 
25
// HAVE_STRING_SPRINTF_MS - whether the MS (%I64d and %I64u)
 
26
// specifiers are supported.
 
27
 
 
28
// HAVE_STRING_SPRINTF_ISO - whether the ISO
 
29
// (%lld, %llu, %Lf) specifiers are supported.
 
30
 
 
31
#if defined ENABLE_GLIB && ENABLE_GLIB
 
32
        #define HAVE_STRING_SPRINTF_MS 0
 
33
        #define HAVE_STRING_SPRINTF_ISO 1
 
34
 
 
35
#elif defined HAVE_ISO_STDIO && HAVE_ISO_STDIO
 
36
        // mingw/ISO has both the MS and ISO specifiers
 
37
        #if defined _WIN32 && defined __GNUC__
 
38
                #define HAVE_STRING_SPRINTF_MS 1
 
39
        #else
 
40
                #define HAVE_STRING_SPRINTF_MS 0
 
41
        #endif
 
42
        #define HAVE_STRING_SPRINTF_ISO 1
 
43
 
 
44
#elif defined HAVE_WIN_SE_FUNCS && HAVE_WIN_SE_FUNCS
 
45
        #define HAVE_STRING_SPRINTF_MS 1
 
46
        #define HAVE_STRING_SPRINTF_ISO 0
 
47
 
 
48
#elif defined HAVE__VSNPRINTF && HAVE__VSNPRINTF
 
49
        #define HAVE_STRING_SPRINTF_MS 0
 
50
        #define HAVE_STRING_SPRINTF_ISO 1
 
51
 
 
52
#else
 
53
        #warning Cannot detect vsnprintf() availability
 
54
 
 
55
        #define HAVE_STRING_SPRINTF_MS 0
 
56
        #define HAVE_STRING_SPRINTF_ISO 0
 
57
#endif
 
58
 
 
59
 
 
60
 
 
61
 
 
62
// HZ_FUNC_STRING_SPRINTF_CHECK - gcc printf format attribute checker,
 
63
// configured according to MS or ISO features (prefers ISO over MS).
 
64
 
 
65
#if HAVE_STRING_SPRINTF_ISO
 
66
        #define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx) HZ_FUNC_PRINTF_ISO_CHECK(format_idx, check_idx)
 
67
#elif HAVE_STRING_SPRINTF_MS
 
68
        #define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx) HZ_FUNC_PRINTF_MS_CHECK(format_idx, check_idx)
 
69
#else
 
70
        #define HZ_FUNC_STRING_SPRINTF_CHECK(format_idx, check_idx)
 
71
#endif
 
72
 
 
73
 
 
74
 
 
75
 
 
76
 
 
77
#endif
 
78
 
 
79
/// @}