Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/metal-cpp/patches/0001-add-missing-apis.patch
21155 views
1
thirdparty/metal-cpp/Foundation/NSData.hpp | 6 ++++++
2
thirdparty/metal-cpp/Foundation/NSPrivate.hpp | 4 ++++
3
thirdparty/metal-cpp/Foundation/NSString.hpp | 7 +++++++
4
3 files changed, 17 insertions(+)
5
6
diff --git a/thirdparty/metal-cpp/Foundation/NSData.hpp b/thirdparty/metal-cpp/Foundation/NSData.hpp
7
index 3ad360609f..fbf3f20343 100644
8
--- a/thirdparty/metal-cpp/Foundation/NSData.hpp
9
+++ b/thirdparty/metal-cpp/Foundation/NSData.hpp
10
@@ -33,6 +33,7 @@ class Data : public Copying<Data>
11
{
12
public:
13
void* mutableBytes() const;
14
+ void* bytes() const;
15
UInteger length() const;
16
};
17
}
18
@@ -44,6 +45,11 @@ _NS_INLINE void* NS::Data::mutableBytes() const
19
return Object::sendMessage<void*>(this, _NS_PRIVATE_SEL(mutableBytes));
20
}
21
22
+_NS_INLINE void* NS::Data::bytes() const
23
+{
24
+ return Object::sendMessage<void*>(this, _NS_PRIVATE_SEL(bytes));
25
+}
26
+
27
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
28
29
_NS_INLINE NS::UInteger NS::Data::length() const
30
diff --git a/thirdparty/metal-cpp/Foundation/NSPrivate.hpp b/thirdparty/metal-cpp/Foundation/NSPrivate.hpp
31
index f8d87004f3..17909fbd2a 100644
32
--- a/thirdparty/metal-cpp/Foundation/NSPrivate.hpp
33
+++ b/thirdparty/metal-cpp/Foundation/NSPrivate.hpp
34
@@ -272,6 +272,8 @@ namespace Private
35
"initWithBytes:objCType:");
36
_NS_PRIVATE_DEF_SEL(initWithBytesNoCopy_length_encoding_freeWhenDone_,
37
"initWithBytesNoCopy:length:encoding:freeWhenDone:");
38
+ _NS_PRIVATE_DEF_SEL(initWithBytes_length_encoding_,
39
+ "initWithBytes:length:encoding:");
40
_NS_PRIVATE_DEF_SEL(initWithChar_,
41
"initWithChar:");
42
_NS_PRIVATE_DEF_SEL(initWithCoder_,
43
@@ -372,6 +374,8 @@ namespace Private
44
"methodSignatureForSelector:");
45
_NS_PRIVATE_DEF_SEL(mutableBytes,
46
"mutableBytes");
47
+ _NS_PRIVATE_DEF_SEL(bytes,
48
+ "bytes");
49
_NS_PRIVATE_DEF_SEL(name,
50
"name");
51
_NS_PRIVATE_DEF_SEL(nextObject,
52
diff --git a/thirdparty/metal-cpp/Foundation/NSString.hpp b/thirdparty/metal-cpp/Foundation/NSString.hpp
53
index 07ba3f8d39..d4d0c52ec2 100644
54
--- a/thirdparty/metal-cpp/Foundation/NSString.hpp
55
+++ b/thirdparty/metal-cpp/Foundation/NSString.hpp
56
@@ -87,6 +87,7 @@ public:
57
String* init();
58
String* init(const String* pString);
59
String* init(const char* pString, StringEncoding encoding);
60
+ String* init(void* pBytes, UInteger len, StringEncoding encoding);
61
String* init(void* pBytes, UInteger len, StringEncoding encoding, bool freeBuffer);
62
63
unichar character(UInteger index) const;
64
@@ -168,6 +169,12 @@ _NS_INLINE NS::String* NS::String::init(const char* pString, StringEncoding enco
65
66
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
67
68
+_NS_INLINE NS::String* NS::String::init(void* pBytes, UInteger len, StringEncoding encoding)
69
+{
70
+ return Object::sendMessage<String*>(this, _NS_PRIVATE_SEL(initWithBytes_length_encoding_), pBytes, len, encoding);
71
+}
72
+//-------------------------------------------------------------------------------------------------------------------------------------------------------------
73
+
74
_NS_INLINE NS::String* NS::String::init(void* pBytes, UInteger len, StringEncoding encoding, bool freeBuffer)
75
{
76
return Object::sendMessage<String*>(this, _NS_PRIVATE_SEL(initWithBytesNoCopy_length_encoding_freeWhenDone_), pBytes, len, encoding, freeBuffer);
77
78