blob: d49f0177d1b54432efcaf1c27855b1ba71bf97b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#import "MGLFoundation.h"
#import "MGLSignpost.h"
os_log_t MGLDefaultSignpostLog = NULL;
os_signpost_id_t MGLDefaultSignpost = OS_SIGNPOST_ID_INVALID;
void destroyDefaultSignpostVaribles(void) __attribute__((destructor));
void destroyDefaultSignpostVaribles() {
MGLDefaultSignpostLog = NULL;
MGLDefaultSignpost = OS_SIGNPOST_ID_INVALID;
}
void createDefaultSignpostVaribles(void) __attribute__((constructor));
void createDefaultSignpostVaribles() {
MGLDefaultSignpostLog = MGLSignpostLogCreate("MGLSignposts");
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
MGLDefaultSignpost = os_signpost_id_generate(MGLDefaultSignpostLog);
}
}
os_log_t MGLSignpostLogCreate(const char* name) {
if (name && [NSUserDefaults.standardUserDefaults boolForKey:@"MGLSignpostsEnabled"]) {
return os_log_create("com.mapbox.mapbox", name);
}
else {
return OS_LOG_DISABLED;
}
}
|