xamarin-macios/runtime/shared.h

62 строки
1.3 KiB
C
Исходник Обычный вид История

2016-04-21 15:19:32 +03:00
//
// shared.h: Shared native code between Xamarin.iOS and Xamarin.Mac.
//
//
// Authors:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright 2013 Xamarin Inc.
//
#ifndef __SHARED_H__
#define __SHARED_H__
#include <stdbool.h>
[runtime] Use newer atomic functions. (#7119) Fixes these warnings: shared.m:252:6: warning: 'OSAtomicDecrement32Barrier' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_sub() from <atomic> instead [-Wdeprecated-declarations] if (OSAtomicDecrement32Barrier (&bl->descriptor->ref_count) == 0) { ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:201:9: note: 'OSAtomicDecrement32Barrier' has been explicitly marked deprecated here int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue ); ^ shared.m:270:2: warning: 'OSAtomicIncrement32' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations] OSAtomicIncrement32 (&source->descriptor->ref_count); ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:171:9: note: 'OSAtomicIncrement32' has been explicitly marked deprecated here int32_t OSAtomicIncrement32( volatile int32_t *__theValue ); ^ monotouch-debug.m:309:10: warning: 'OSAtomicIncrement32Barrier' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations] int c = OSAtomicIncrement32Barrier (&http_send_counter); ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:182:9: note: 'OSAtomicIncrement32Barrier' has been explicitly marked deprecated here int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue ); ^
2019-09-27 08:15:59 +03:00
#include <stdatomic.h>
2016-04-21 15:19:32 +03:00
#ifdef __cplusplus
extern "C" {
#endif
typedef void (init_cocoa_func) (void);
void xamarin_initialize_cocoa_threads (init_cocoa_func *func);
2016-04-21 15:19:32 +03:00
void xamarin_install_nsautoreleasepool_hooks ();
2016-04-21 15:19:32 +03:00
id xamarin_init_nsthread (id obj, bool is_direct, id target, SEL sel, id arg);
void xamarin_insert_dllmap ();
2016-04-21 15:19:32 +03:00
/*
* Block support
*/
struct Xamarin_block_descriptor {
unsigned long int reserved; // NULL
unsigned long int size; // sizeof(struct Block_literal_1)
// optional helper functions
void (*copy_helper) (void *dst, void *src); // IFF (1<<25)
void (*dispose_helper)(void *src); // IFF (1<<25)
// required ABI.2010.3.16
const char *signature; // IFF (1<<30)
[runtime] Use newer atomic functions. (#7119) Fixes these warnings: shared.m:252:6: warning: 'OSAtomicDecrement32Barrier' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_sub() from <atomic> instead [-Wdeprecated-declarations] if (OSAtomicDecrement32Barrier (&bl->descriptor->ref_count) == 0) { ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:201:9: note: 'OSAtomicDecrement32Barrier' has been explicitly marked deprecated here int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue ); ^ shared.m:270:2: warning: 'OSAtomicIncrement32' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations] OSAtomicIncrement32 (&source->descriptor->ref_count); ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:171:9: note: 'OSAtomicIncrement32' has been explicitly marked deprecated here int32_t OSAtomicIncrement32( volatile int32_t *__theValue ); ^ monotouch-debug.m:309:10: warning: 'OSAtomicIncrement32Barrier' is deprecated: first deprecated in watchOS 3.0 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations] int c = OSAtomicIncrement32Barrier (&http_send_counter); ^ /Applications/Xcode11.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS6.0.sdk/usr/include/libkern/OSAtomicDeprecated.h:182:9: note: 'OSAtomicIncrement32Barrier' has been explicitly marked deprecated here int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue ); ^
2019-09-27 08:15:59 +03:00
int _Atomic ref_count;
2016-04-21 15:19:32 +03:00
// variable-length string
};
struct Block_literal {
void *isa;
int flags;
int reserved;
void (*invoke)(void *, ...);
struct Xamarin_block_descriptor *descriptor;
void *local_handle;
void *global_handle;
};
struct Xamarin_block_descriptor * xamarin_get_block_descriptor ();
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __SHARED_H__ */