summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/mac/SoftLinking.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/mac/SoftLinking.h')
-rw-r--r--WebCore/platform/mac/SoftLinking.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/WebCore/platform/mac/SoftLinking.h b/WebCore/platform/mac/SoftLinking.h
index d470b29..ce72f34 100644
--- a/WebCore/platform/mac/SoftLinking.h
+++ b/WebCore/platform/mac/SoftLinking.h
@@ -98,3 +98,22 @@
get##name = name##Function; \
return pointer##name; \
}
+
+#define SOFT_LINK_CONSTANT(framework, name, type) \
+ static type init##name(); \
+ static type (*get##name)() = init##name; \
+ static type constant##name; \
+ \
+ static type name##Function() \
+ { \
+ return constant##name; \
+ }\
+ \
+ static type init##name() \
+ { \
+ void* constant = dlsym(framework##Library(), #name); \
+ ASSERT(constant); \
+ constant##name = *static_cast<type*>(constant); \
+ get##name = name##Function; \
+ return constant##name; \
+ }