Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18848)

Side by Side Diff: Modules/_decimal/mptypes.h

Issue 7652: Merge C version of decimal into py3k.
Patch Set: Created 8 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2008-2010 Stefan Krah. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28
29 #ifndef MPTYPES_H
30 #define MPTYPES_H
31
32 #if defined(_MSC_VER)
33 #define PRIi64 "lld"
34 #define PRIu64 "llu"
35 #define PRIi32 "d"
36 #define PRIu32 "u"
37 #endif
38
39 #if defined(CONFIG_64)
40 #if defined(_MSC_VER) || defined(__OpenBSD__) || defined(__APPLE__)
41 #define PRI_mpd_uint_t "llu"
42 #define PRI_mpd_size_t "llu"
43 #define PRI_mpd_ssize_t "lld"
44 #else
45 #define PRI_mpd_uint_t "lu"
46 #define PRI_mpd_size_t "lu"
47 #define PRI_mpd_ssize_t "ld"
48 #endif
49 #define PRI_time_t "ld"
50 #define CONV_mpd_ssize_t "L"
amaury.forgeotdarc 2011/12/01 00:12:04 This macro is only useful for Python (in PyArg_Par
skrah 2011/12/02 01:27:38 OK.
skrah 2011/12/04 16:09:41 http://hg.python.org/features/cdecimal/rev/4c003fb
51 #define ONE_UM 1ULL
52 #elif defined(CONFIG_32)
53 #define PRI_mpd_uint_t "u"
54 #define PRI_mpd_size_t "u"
55 #define PRI_mpd_ssize_t "d"
56 #if defined (__OpenBSD__)
57 #undef PRI_mpd_size_t
58 #define PRI_mpd_size_t "lu"
59 #define PRI_time_t "d"
60 #elif defined(__FreeBSD__)
61 #if defined(__x86_64__)
62 #define PRI_time_t "ld"
63 #else
64 #define PRI_time_t "d"
65 #endif
66 #else
67 #define PRI_time_t "ld"
68 #endif
69 #if MPD_SSIZE_MAX != INT_MAX
70 #error "define CONV_mpd_ssize_t"
71 #endif
72 #define CONV_mpd_ssize_t "i"
73 #define ONE_UM 1UL
74 #else
75 #error "define CONFIG_64 or CONFIG_32"
76 #endif
77
78 #endif
79
80
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+