@@ -20,14 +20,16 @@ namespace Fortran::runtime {
20
20
class Descriptor ;
21
21
22
22
template <typename CHAR>
23
- int CharacterScalarCompare (
23
+ RT_API_ATTRS int CharacterScalarCompare (
24
24
const CHAR *x, const CHAR *y, std::size_t xChars, std::size_t yChars);
25
- extern template int CharacterScalarCompare<char >(
25
+ extern template RT_API_ATTRS int CharacterScalarCompare<char >(
26
26
const char *x, const char *y, std::size_t xChars, std::size_t yChars);
27
- extern template int CharacterScalarCompare<char16_t >(const char16_t *x,
28
- const char16_t *y, std::size_t xChars, std::size_t yChars);
29
- extern template int CharacterScalarCompare<char32_t >(const char32_t *x,
30
- const char32_t *y, std::size_t xChars, std::size_t yChars);
27
+ extern template RT_API_ATTRS int CharacterScalarCompare<char16_t >(
28
+ const char16_t *x, const char16_t *y, std::size_t xChars,
29
+ std::size_t yChars);
30
+ extern template RT_API_ATTRS int CharacterScalarCompare<char32_t >(
31
+ const char32_t *x, const char32_t *y, std::size_t xChars,
32
+ std::size_t yChars);
31
33
32
34
extern " C" {
33
35
@@ -36,12 +38,12 @@ extern "C" {
36
38
// initialized CHARACTER allocatable scalar or array descriptor -- use
37
39
// AllocatableInitCharacter() to set one up. Crashes when not
38
40
// conforming. Assumes independence of data.
39
- void RTNAME (CharacterConcatenate)(Descriptor &accumulator,
41
+ void RTDECL (CharacterConcatenate)(Descriptor &accumulator,
40
42
const Descriptor &from, const char *sourceFile = nullptr ,
41
43
int sourceLine = 0 );
42
44
43
45
// Convenience specialization for ASCII scalars concatenation.
44
- void RTNAME (CharacterConcatenateScalar1)(
46
+ void RTDECL (CharacterConcatenateScalar1)(
45
47
Descriptor &accumulator, const char *from, std::size_t chars);
46
48
47
49
// CHARACTER comparisons. The kinds must match. Like std::memcmp(),
@@ -52,77 +54,77 @@ void RTNAME(CharacterConcatenateScalar1)(
52
54
// N.B.: Calls to the restricted specific intrinsic functions LGE, LGT, LLE,
53
55
// & LLT are converted into calls to these during lowering; they don't have
54
56
// to be able to be passed as actual procedure arguments.
55
- int RTNAME (CharacterCompareScalar)(const Descriptor &, const Descriptor &);
56
- int RTNAME (CharacterCompareScalar1)(
57
+ int RTDECL (CharacterCompareScalar)(const Descriptor &, const Descriptor &);
58
+ int RTDECL (CharacterCompareScalar1)(
57
59
const char *x, const char *y, std::size_t xChars, std::size_t yChars);
58
- int RTNAME (CharacterCompareScalar2)(const char16_t *x, const char16_t *y,
60
+ int RTDECL (CharacterCompareScalar2)(const char16_t *x, const char16_t *y,
59
61
std::size_t xChars, std::size_t yChars);
60
- int RTNAME (CharacterCompareScalar4)(const char32_t *x, const char32_t *y,
62
+ int RTDECL (CharacterCompareScalar4)(const char32_t *x, const char32_t *y,
61
63
std::size_t xChars, std::size_t yChars);
62
64
63
65
// General CHARACTER comparison; the result is a LOGICAL(KIND=1) array that
64
66
// is established and populated.
65
- void RTNAME (CharacterCompare)(
67
+ void RTDECL (CharacterCompare)(
66
68
Descriptor &result, const Descriptor &, const Descriptor &);
67
69
68
70
// Special-case support for optimized ASCII scalar expressions.
69
71
70
72
// Copies data from 'rhs' to the remaining space (lhsLength - offset)
71
73
// in 'lhs', if any. Returns the new offset. Assumes independence.
72
- std::size_t RTNAME (CharacterAppend1)(char *lhs, std::size_t lhsBytes,
74
+ std::size_t RTDECL (CharacterAppend1)(char *lhs, std::size_t lhsBytes,
73
75
std::size_t offset, const char *rhs, std::size_t rhsBytes);
74
76
75
77
// Appends any necessary spaces to a CHARACTER(KIND=1) scalar.
76
- void RTNAME (CharacterPad1)(char *lhs, std::size_t bytes, std::size_t offset);
78
+ void RTDECL (CharacterPad1)(char *lhs, std::size_t bytes, std::size_t offset);
77
79
78
80
// Intrinsic functions
79
81
// The result descriptors below are all established by the runtime.
80
- void RTNAME (Adjustl)(Descriptor &result, const Descriptor &,
82
+ void RTDECL (Adjustl)(Descriptor &result, const Descriptor &,
81
83
const char *sourceFile = nullptr , int sourceLine = 0 );
82
- void RTNAME (Adjustr)(Descriptor &result, const Descriptor &,
84
+ void RTDECL (Adjustr)(Descriptor &result, const Descriptor &,
83
85
const char *sourceFile = nullptr , int sourceLine = 0 );
84
- std::size_t RTNAME (LenTrim1)(const char *, std::size_t );
85
- std::size_t RTNAME (LenTrim2)(const char16_t *, std::size_t );
86
- std::size_t RTNAME (LenTrim4)(const char32_t *, std::size_t );
87
- void RTNAME (LenTrim)(Descriptor &result, const Descriptor &, int kind,
86
+ std::size_t RTDECL (LenTrim1)(const char *, std::size_t );
87
+ std::size_t RTDECL (LenTrim2)(const char16_t *, std::size_t );
88
+ std::size_t RTDECL (LenTrim4)(const char32_t *, std::size_t );
89
+ void RTDECL (LenTrim)(Descriptor &result, const Descriptor &, int kind,
88
90
const char *sourceFile = nullptr , int sourceLine = 0 );
89
- void RTNAME (Repeat)(Descriptor &result, const Descriptor &string,
91
+ void RTDECL (Repeat)(Descriptor &result, const Descriptor &string,
90
92
std::int64_t ncopies, const char *sourceFile = nullptr , int sourceLine = 0 );
91
- void RTNAME (Trim)(Descriptor &result, const Descriptor &string,
93
+ void RTDECL (Trim)(Descriptor &result, const Descriptor &string,
92
94
const char *sourceFile = nullptr , int sourceLine = 0 );
93
95
94
- void RTNAME (CharacterMax)(Descriptor &accumulator, const Descriptor &x,
96
+ void RTDECL (CharacterMax)(Descriptor &accumulator, const Descriptor &x,
95
97
const char *sourceFile = nullptr , int sourceLine = 0 );
96
- void RTNAME (CharacterMin)(Descriptor &accumulator, const Descriptor &x,
98
+ void RTDECL (CharacterMin)(Descriptor &accumulator, const Descriptor &x,
97
99
const char *sourceFile = nullptr , int sourceLine = 0 );
98
100
99
- std::size_t RTNAME (Index1)(const char *, std::size_t , const char *substring,
101
+ std::size_t RTDECL (Index1)(const char *, std::size_t , const char *substring,
100
102
std::size_t , bool back = false );
101
- std::size_t RTNAME (Index2)(const char16_t *, std::size_t ,
103
+ std::size_t RTDECL (Index2)(const char16_t *, std::size_t ,
102
104
const char16_t *substring, std::size_t , bool back = false );
103
- std::size_t RTNAME (Index4)(const char32_t *, std::size_t ,
105
+ std::size_t RTDECL (Index4)(const char32_t *, std::size_t ,
104
106
const char32_t *substring, std::size_t , bool back = false );
105
- void RTNAME (Index)(Descriptor &result, const Descriptor &string,
107
+ void RTDECL (Index)(Descriptor &result, const Descriptor &string,
106
108
const Descriptor &substring, const Descriptor *back /* can be null*/ ,
107
109
int kind, const char *sourceFile = nullptr , int sourceLine = 0 );
108
110
109
- std::size_t RTNAME (Scan1)(
111
+ std::size_t RTDECL (Scan1)(
110
112
const char *, std::size_t , const char *set, std::size_t , bool back = false );
111
- std::size_t RTNAME (Scan2)(const char16_t *, std::size_t , const char16_t *set,
113
+ std::size_t RTDECL (Scan2)(const char16_t *, std::size_t , const char16_t *set,
112
114
std::size_t , bool back = false );
113
- std::size_t RTNAME (Scan4)(const char32_t *, std::size_t , const char32_t *set,
115
+ std::size_t RTDECL (Scan4)(const char32_t *, std::size_t , const char32_t *set,
114
116
std::size_t , bool back = false );
115
- void RTNAME (Scan)(Descriptor &result, const Descriptor &string,
117
+ void RTDECL (Scan)(Descriptor &result, const Descriptor &string,
116
118
const Descriptor &set, const Descriptor *back /* can be null*/ , int kind,
117
119
const char *sourceFile = nullptr , int sourceLine = 0 );
118
120
119
- std::size_t RTNAME (Verify1)(
121
+ std::size_t RTDECL (Verify1)(
120
122
const char *, std::size_t , const char *set, std::size_t , bool back = false );
121
- std::size_t RTNAME (Verify2)(const char16_t *, std::size_t , const char16_t *set,
123
+ std::size_t RTDECL (Verify2)(const char16_t *, std::size_t , const char16_t *set,
122
124
std::size_t , bool back = false );
123
- std::size_t RTNAME (Verify4)(const char32_t *, std::size_t , const char32_t *set,
125
+ std::size_t RTDECL (Verify4)(const char32_t *, std::size_t , const char32_t *set,
124
126
std::size_t , bool back = false );
125
- void RTNAME (Verify)(Descriptor &result, const Descriptor &string,
127
+ void RTDECL (Verify)(Descriptor &result, const Descriptor &string,
126
128
const Descriptor &set, const Descriptor *back /* can be null*/ , int kind,
127
129
const char *sourceFile = nullptr , int sourceLine = 0 );
128
130
}
0 commit comments