File tree 2 files changed +16
-13
lines changed
2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1
1
%include " std_vector.i"
2
2
%include " std_string.i"
3
+ %include " stdint.i"
3
4
4
- %template () std::vector<unsigned long long >;
5
5
%template () std::vector<S2CellId>;
6
6
%template () std::vector<S2Point>;
7
7
%template () std::vector<S2LatLng>;
8
8
9
- %apply int {int32};
10
- %apply unsigned long long {uint64};
11
9
%apply std::string {string};
12
- %apply std::vector<unsigned long long > const & {std::vector<uint64> const &};
13
10
14
11
// Standard Google convention is to ignore all functions and methods, and
15
12
// selectively add back those for which wrapping is both required and
Original file line number Diff line number Diff line change 16
16
#ifndef S2_BASE_INTEGRAL_TYPES_H_
17
17
#define S2_BASE_INTEGRAL_TYPES_H_
18
18
19
- using int8 = signed char ;
20
- using int16 = short ;
21
- using int32 = int ;
22
- using int64 = long long ;
19
+ #include < cstdint>
20
+ #include < type_traits>
23
21
24
- using uint8 = unsigned char ;
25
- using uint16 = unsigned short ;
26
- using uint32 = unsigned int ;
27
- using uint64 = unsigned long long ;
22
+ using int8 = int8_t ;
23
+ using int16 = int16_t ;
24
+ using int32 = int32_t ;
25
+ using int64 = int64_t ;
28
26
29
- using uword_t = unsigned long ;
27
+ using uint8 = uint8_t ;
28
+ using uint16 = uint16_t ;
29
+ using uint32 = uint32_t ;
30
+ using uint64 = uint64_t ;
31
+
32
+ static_assert (sizeof (void *) == 8 || sizeof(void *) == 4,
33
+ "void * must be 32 or 64 bits.");
34
+ using uword_t =
35
+ std::conditional<sizeof (void *) == 8 , uint64_t , uint32_t >::type;
30
36
31
37
#endif // S2_BASE_INTEGRAL_TYPES_H_
You can’t perform that action at this time.
0 commit comments