Skip to content

Commit 33dcb2f

Browse files
committed
[[ StdLib ]] Fix issues with stdlib foreign handlers
This patch comments out the foreign handler definitions in stdlib for all which have no implementation. Additionally, it adds MC_DLLEXPORT_DEF to two previously unexported sort module handlers.
1 parent f5764f1 commit 33dcb2f

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

libscript/src/binary.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public foreign handler MCBinaryExecPutBytesAfter(in Source as Data, inout Target
2727

2828
public foreign handler MCBinaryEvalConcatenateBytes(in Left as Data, in Right as Data, out Result as Data) returns nothing binds to "<builtin>"
2929

30+
/* No implementation
3031
public foreign handler MCBinaryEvalContainsBytes(in Target as Data, in Needle as Data, out Value as CBool) returns nothing binds to "<builtin>"
32+
*/
3133

3234
public foreign handler MCBinaryEvalIsEqualTo(in Left as Data, in Right as Data, out Value as CBool) returns nothing binds to "<builtin>"
3335
public foreign handler MCBinaryEvalIsNotEqualTo(in Left as Data, in Right as Data, out Value as CBool) returns nothing binds to "<builtin>"

libscript/src/byte.lcb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ public foreign handler MCByteEvalOffsetOfBytes(in IsLast as CBool, in Needle as
2828
public foreign handler MCByteEvalOffsetOfBytesBefore(in IsLast as CBool, in Needle as Data, in Before as LCIndex, in Target as Data, out Offset as LCUIndex) returns nothing binds to "<builtin>"
2929
public foreign handler MCByteEvalOffsetOfBytesAfter(in IsLast as CBool, in Needle as Data, in After as LCIndex, in Target as Data, out Offset as LCUIndex) returns nothing binds to "<builtin>"
3030

31-
public foreign handler MCByteEvalIsAmongTheBytesOf(in Needle as Data, in Target as Data, out Value as CBool) returns nothing binds to "<builtin>"
31+
// public foreign handler MCByteEvalIsAmongTheBytesOf(in Needle as Data, in Target as Data, out Value as CBool) returns nothing binds to "<builtin>"
3232

3333
public foreign handler MCByteEvalContainsBytes(in Target as Data, in Needle as Data, out Value as CBool) returns nothing binds to "<builtin>"
34-
public foreign handler MCByteEvalIsInBytes(in Needle as Data, in Target as Data, out Value as CBool) returns nothing binds to "<builtin>"
3534
public foreign handler MCByteEvalBeginsWithBytes(in Target as Data, in Needle as Data, out Value as CBool) returns nothing binds to "<builtin>"
3635
public foreign handler MCByteEvalEndsWithBytes(in Target as Data, in Needle as Data, out Value as CBool) returns nothing binds to "<builtin>"
3736

37+
/* No implementation
38+
public foreign handler MCByteEvalIsInBytes(in Needle as Data, in Target as Data, out Value as CBool) returns nothing binds to "<builtin>"
39+
*/
40+
3841
public foreign handler MCByteFetchByteOf(in Index as LCIndex, in Target as Data, out Value as Data) returns nothing binds to "<builtin>"
3942
public foreign handler MCByteStoreByteOf(in Value as Data, in Index as LCIndex, inout Target as Data) returns nothing binds to "<builtin>"
4043
public foreign handler MCByteFetchByteRangeOf(in Start as LCIndex, in Finish as LCIndex, in Target as Data, out Value as Data) returns nothing binds to "<builtin>"
@@ -169,11 +172,13 @@ Description:
169172
Tags: Binary
170173
*/
171174

175+
/* No implementation
172176
syntax ByteIsInData is neutral binary operator with comparison precedence
173177
<Needle: Expression> "is" "in" <Target: Expression>
174178
begin
175179
MCByteEvalIsInBytes(Needle, Target, output)
176180
end syntax
181+
*/
177182

178183
--
179184

libscript/src/char.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ public foreign handler MCCharEvalNumberOfCharsIn(in Target as String, out Count
3131

3232
public foreign handler MCCharEvalIsAmongTheCharsOf(in Needle as String, in Target as String, out Value as CBool) returns nothing binds to "<builtin>"
3333

34+
/* No implementation
3435
public foreign handler MCCharStoreBeforeCharOf(in Value as String, in Index as LCIndex, inout Target as String) returns nothing binds to "<builtin>"
3536
public foreign handler MCCharStoreAfterCharOf(in Value as String, in Index as LCIndex, inout Target as String) returns nothing binds to "<builtin>"
37+
*/
3638

3739
public foreign handler MCCharEvalOffsetOfChars(in IsLast as CBool, in Needle as String, in Target as String, out Offset as LCUIndex) returns nothing binds to "<builtin>"
3840
public foreign handler MCCharEvalOffsetOfCharsBefore(in IsLast as CBool, in Needle as String, in Before as LCIndex, in Target as String, out Offset as LCUIndex) returns nothing binds to "<builtin>"

libscript/src/codeunit.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public foreign handler MCCodeunitStoreCodeunitRangeOf(in Value as String, in Sta
2929

3030
public foreign handler MCCodeunitEvalNumberOfCodeunitsIn(in Target as String, out Count as LCUIndex) returns nothing binds to "<builtin>"
3131

32+
/* No implementation
3233
public foreign handler MCCodeunitStoreBeforeCodeunitOf(in Value as String, in Index as LCIndex, inout Target as String) returns nothing binds to "<builtin>"
3334
public foreign handler MCCodeunitStoreAfterCodeunitOf(in Value as String, in Index as LCIndex, inout Target as String) returns nothing binds to "<builtin>"
35+
*/
3436

3537
public foreign handler MCCodeunitEvalOffsetOfCodeunits(in IsLast as CBool, in Needle as String, in Target as String, out Offset as LCUIndex) returns nothing binds to "<builtin>"
3638
public foreign handler MCCodeunitEvalOffsetOfCodeunitsBefore(in IsLast as CBool, in Needle as String, in Before as LCIndex, in Target as String, out Offset as LCUIndex) returns nothing binds to "<builtin>"

libscript/src/module-sort.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ extern "C" MC_DLLEXPORT_DEF void MCSortExecSortListDescendingNumeric(MCProperLis
186186
MCSortExecSortListNumeric(x_target, true);
187187
}
188188

189-
void MCSortExecSortListDateTime(MCProperListRef& x_target, bool p_descending)
189+
static void MCSortExecSortListDateTime(MCProperListRef& x_target, bool p_descending)
190190
{
191191
MCAutoProperListRef t_mutable_list;
192192
if (!MCProperListMutableCopy(x_target, &t_mutable_list))
@@ -201,12 +201,12 @@ void MCSortExecSortListDateTime(MCProperListRef& x_target, bool p_descending)
201201
MCValueAssign(x_target, *t_sorted_list);
202202
}
203203

204-
void MCSortExecSortListAscendingDateTime(MCProperListRef& x_target)
204+
extern "C" MC_DLLEXPORT_DEF void MCSortExecSortListAscendingDateTime(MCProperListRef& x_target)
205205
{
206206
MCSortExecSortListDateTime(x_target, false);
207207
}
208208

209-
void MCSortExecSortListDescendingDateTime(MCProperListRef& x_target)
209+
extern "C" MC_DLLEXPORT_DEF void MCSortExecSortListDescendingDateTime(MCProperListRef& x_target)
210210
{
211211
MCSortExecSortListDateTime(x_target, true);
212212
}

libscript/src/string.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public foreign handler MCStringEvalConcatenateWithSpace(in Left as String, in Ri
3434
public foreign handler MCStringEvalLowercaseOf(in Source as String, out Result as String) returns nothing binds to "<builtin>"
3535
public foreign handler MCStringEvalUppercaseOf(in Source as String, out Result as String) returns nothing binds to "<builtin>"
3636

37+
/* No implementation
3738
// The following all need some notion of context
3839
public foreign handler MCStringEvalBeginsWith(in Source as String, in Prefix as String, out Result as CBool) returns nothing binds to "<builtin>"
3940
public foreign handler MCStringEvalEndsWith(in Source as String, in Suffix as String, out Result as CBool) returns nothing binds to "<builtin>"
@@ -45,6 +46,7 @@ public foreign handler MCStringEvalLastOffset(in Needle as String, in Source as
4546
public foreign handler MCStringEvalLastOffsetBefore(in Needle as String, in Before as LCIndex, in Source as String, out Result as LCIndex) returns nothing binds to "<builtin>"
4647

4748
public foreign handler MCStringEvalContainsChars(in Source as String, in Needle as String, out Result as CBool) returns nothing binds to "<builtin>"
49+
*/
4850

4951
public foreign handler MCStringEvalIsEqualTo(in Left as String, in Right as String, out Value as CBool) returns nothing binds to "<builtin>"
5052
public foreign handler MCStringEvalIsNotEqualTo(in Left as String, in Right as String, out Value as CBool) returns nothing binds to "<builtin>"

0 commit comments

Comments
 (0)