summaryrefslogtreecommitdiff
path: root/src/cairo-compiler-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-compiler-private.h')
-rw-r--r--src/cairo-compiler-private.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index c3814d2be..0d9229ee2 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -53,6 +53,36 @@
#define CAIRO_STACK_ARRAY_LENGTH(T) (CAIRO_STACK_BUFFER_SIZE / sizeof(T))
+/*
+ * The goal of this block is to define the following macros for
+ * providing faster linkage to functions in the public API for calls
+ * from within cairo.
+ *
+ * slim_hidden_proto(f)
+ * slim_hidden_proto_no_warn(f)
+ *
+ * Declares `f' as a library internal function and hides the
+ * function from the global symbol table. This macro must be
+ * expanded after `f' has been declared with a prototype but before
+ * any calls to the function are seen by the compiler. The no_warn
+ * variant inhibits warnings about the return value being unused at
+ * call sites. The macro works by renaming `f' to an internal name
+ * in the symbol table and hiding that. As far as cairo internal
+ * calls are concerned they're calling a library internal function
+ * and thus don't need to bounce via the PLT.
+ *
+ * slim_hidden_def(f)
+ *
+ * Exports `f' back to the global symbol table. This macro must be
+ * expanded right after the function definition and only for symbols
+ * hidden previously with slim_hidden_proto(). The macro works by
+ * adding a global entry to the symbol table which points at the
+ * internal name of `f' created by slim_hidden_proto().
+ *
+ * Functions in the public API which aren't called by the library
+ * don't need to be hidden and re-exported using the slim hidden
+ * macros.
+ */
#if __GNUC__ >= 3 && defined(__ELF__) && !defined(__sun)
# define slim_hidden_proto(name) slim_hidden_proto1(name, slim_hidden_int_name(name)) cairo_private
# define slim_hidden_proto_no_warn(name) slim_hidden_proto1(name, slim_hidden_int_name(name)) cairo_private_no_warn