File tree Expand file tree Collapse file tree 4 files changed +21
-14
lines changed Expand file tree Collapse file tree 4 files changed +21
-14
lines changed Original file line number Diff line number Diff line change
1
+ ! File : typedef_sizet_runme.F90
2
+
3
+ #include " fassert.h"
4
+
5
+ program typedef_sizet_runme
6
+ use typedef_sizet
7
+ use ISO_C_BINDING
8
+ implicit none
9
+ integer (C_SIZE_T) :: inp, outp
10
+
11
+ inp = 1234_c_size_t
12
+ outp = identity_size(inp)
13
+ ASSERT(inp == outp)
14
+ end program
Original file line number Diff line number Diff line change 1
1
%module typedef_sizet
2
2
3
+ #ifdef SWIGFORTRAN
4
+ // Avoid shadowing intrinsic size
5
+ %rename(" identity_size" ) size;
6
+ #endif
7
+
3
8
typedef unsigned long long size_t ;
4
9
%inline %{
5
- size_t size (size_t x) {return x; }
10
+ size_t size (size_t x) {return x; }
6
11
%}
Original file line number Diff line number Diff line change 10
10
11
11
%include <typemaps/swigmacros.swg>
12
12
13
- #ifdef __cplusplus
14
- namespace std
15
- {
16
- #endif
17
- typedef unsigned long long size_t;
18
- typedef long long ptrdiff_t;
19
- #ifdef __cplusplus
20
- }
21
- using std::size_t;
22
- using std::ptrdiff_t;
23
- #endif
24
-
25
13
/* -------------------------------------------------------------------------
26
14
* FRAGMENTS
27
15
* ------------------------------------------------------------------------- */
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public:
15
15
// Typedefs
16
16
typedef _Key value_type;
17
17
typedef _Key key_type;
18
- typedef std:: size_t size_type;
18
+ typedef size_t size_type;
19
19
typedef ptrdiff_t difference_type;
20
20
typedef value_type *pointer;
21
21
typedef const value_type *const_pointer;
You can’t perform that action at this time.
0 commit comments