@@ -75,6 +75,9 @@ static bool initialized = false;
75
75
* This function should be called before any other function provided by the PAL
76
76
* to initialize any global state. Typically overridden by PAL implementer.
77
77
*/
78
+ #ifdef _MSC_VER
79
+ #pragma weak et_pal_init
80
+ #endif // _MSC_VER
78
81
void et_pal_init (void ) {
79
82
if (initialized) {
80
83
return ;
@@ -88,6 +91,9 @@ void et_pal_init(void) {
88
91
* Immediately abort execution, setting the device into an error state, if
89
92
* available.
90
93
*/
94
+ #ifdef _MSC_VER
95
+ #pragma weak et_pal_abort
96
+ #endif // _MSC_VER
91
97
ET_NORETURN void et_pal_abort (void ) {
92
98
std::abort ();
93
99
}
@@ -97,6 +103,9 @@ ET_NORETURN void et_pal_abort(void) {
97
103
*
98
104
* @retval Timestamp value in system ticks.
99
105
*/
106
+ #ifdef _MSC_VER
107
+ #pragma weak et_pal_current_ticks
108
+ #endif // _MSC_VER
100
109
et_timestamp_t et_pal_current_ticks (void ) {
101
110
_ASSERT_PAL_INITIALIZED ();
102
111
auto systemCurrentTime = std::chrono::steady_clock::now ();
@@ -113,6 +122,9 @@ et_timestamp_t et_pal_current_ticks(void) {
113
122
*
114
123
* @retval The ratio of nanoseconds to system ticks.
115
124
*/
125
+ #ifdef _MSC_VER
126
+ #pragma weak et_pal_ticks_to_ns_multiplier
127
+ #endif // _MSC_VER
116
128
et_tick_ratio_t et_pal_ticks_to_ns_multiplier (void ) {
117
129
// The system tick interval is 1 nanosecond, so the conversion factor is 1.
118
130
return {1 , 1 };
@@ -130,6 +142,9 @@ et_tick_ratio_t et_pal_ticks_to_ns_multiplier(void) {
130
142
* @param[in] message Message string to log.
131
143
* @param[in] length Message string length.
132
144
*/
145
+ #ifdef _MSC_VER
146
+ #pragma weak et_pal_emit_log_message
147
+ #endif // _MSC_VER
133
148
void et_pal_emit_log_message (
134
149
et_timestamp_t timestamp,
135
150
et_pal_log_level_t level,
@@ -181,6 +196,9 @@ void et_pal_emit_log_message(
181
196
* @returns the allocated memory, or nullptr on failure. Must be freed using
182
197
* et_pal_free().
183
198
*/
199
+ #ifdef _MSC_VER
200
+ #pragma weak et_pal_allocate
201
+ #endif // _MSC_VER
184
202
void * et_pal_allocate (size_t size) {
185
203
return malloc (size);
186
204
}
@@ -190,6 +208,9 @@ void* et_pal_allocate(size_t size) {
190
208
*
191
209
* @param[in] ptr Pointer to memory to free. May be nullptr.
192
210
*/
211
+ #ifdef _MSC_VER
212
+ #pragma weak et_pal_free
213
+ #endif // _MSC_VER
193
214
void et_pal_free (void * ptr) {
194
215
free (ptr);
195
216
}
0 commit comments