BT_HIDDEN macro
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 24 Jan 2013 22:19:22 +0000 (17:19 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Jan 2013 22:19:22 +0000 (17:19 -0500)
This macro will be used across the codebase to set the visibility of a
function to hidden.
Updated also the functions that were setting the attribute manually.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-lexer.l
formats/ctf/metadata/ctf-parser.y
formats/ctf/metadata/ctf-scanner.h
include/babeltrace/babeltrace-internal.h

index 26aa1bce2322d2571a9b57b24d614484009e3cdc..2209a86a6260365e9a4be52e6ff57a81cbd80326 100644 (file)
@@ -31,7 +31,7 @@
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src);
 
 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
index e7dfd80cf847aeea3bcd9ff14d21219984023a3d..72b0978e56f814c700e79bd36bb19c18b93c3f56 100644 (file)
@@ -39,7 +39,7 @@
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yydebug;
 
 /* Join two lists, put "add" at the end of "head".  */
@@ -55,15 +55,15 @@ _bt_list_splice_tail (struct bt_list_head *add, struct bt_list_head *head)
        }
 }
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yyparse(struct ctf_scanner *scanner);
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yylex(union YYSTYPE *yyval, struct ctf_scanner *scanner);
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yylex_init_extra(struct ctf_scanner *scanner, yyscan_t * ptr_yy_globals);
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yylex_destroy(yyscan_t yyscanner);
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 void yyrestart(FILE * in_str, yyscan_t scanner);
 
 struct gc_string {
@@ -101,7 +101,7 @@ static const char *node_type_to_str[] = {
        [ NODE_STRUCT ] = "NODE_STRUCT",
 };
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 const char *node_type(struct ctf_node *node)
 {
        if (node->type < NR_NODE_TYPES)
@@ -132,7 +132,7 @@ static struct gc_string *gc_string_alloc(struct ctf_scanner *scanner,
  * gsrc will be garbage collected immediately, and gstr might be.
  * Should only be used to append characters to a string literal or constant.
  */
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 struct gc_string *gc_string_append(struct ctf_scanner *scanner,
                                   struct gc_string *gstr,
                                   struct gc_string *gsrc)
@@ -211,7 +211,7 @@ static int lookup_type(struct ctf_scanner_scope *s, const char *id)
        return ret;
 }
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int is_type(struct ctf_scanner *scanner, const char *id)
 {
        struct ctf_scanner_scope *it;
@@ -815,13 +815,13 @@ static int set_parent_node(struct ctf_node *node,
        return 0;
 }
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 void yyerror(struct ctf_scanner *scanner, const char *str)
 {
        fprintf(stderr, "error %s\n", str);
 }
  
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int yywrap(void)
 {
        return 1;
index d5650d0a703e7fb39fb77fbf54079243351895dc..21010fd4ef5a467be6453ef65459974fa3a73e07 100644 (file)
@@ -49,7 +49,7 @@ struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner)
        return scanner->ast;
 }
 
-__attribute__((visibility("hidden")))
+BT_HIDDEN
 int is_type(struct ctf_scanner *scanner, const char *id);
 
 #endif /* _CTF_SCANNER_H */
index c567d3952d532ed8aabb16005f6f16f4ad7b4218..6b6fcecfbb3bd24d67066f98824e4fe8085ad68c 100644 (file)
@@ -45,6 +45,11 @@ extern int babeltrace_verbose, babeltrace_debug;
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
 
+/*
+ * BT_HIDDEN: set the hidden attribute for internal functions
+ */
+#define BT_HIDDEN __attribute__((visibility("hidden")))
+
 struct trace_descriptor;
 struct trace_collection {
        GPtrArray *array;       /* struct trace_descriptor */
This page took 0.028334 seconds and 4 git commands to generate.