Imported Upstream version 2.4.3
[platform/upstream/audit.git] / lib / dso.h
1 /* dso.h -- 
2  * Copyright 2005,2006,2009 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 
19  * Authors:
20  *      Steve Grubb <sgrubb@redhat.com>
21  */
22 #ifndef _DSO_H_
23 #define _DSO_H_
24
25 #ifdef PIC
26 # define hidden __attribute__ ((visibility ("hidden")))
27 # define hidden_proto(fct) __hidden_proto (fct, fct##_internal)
28 # define __hidden_proto(fct, internal)  \
29      extern __typeof (fct) internal;    \
30      extern __typeof (fct) fct __asm (#internal) hidden;
31 # if defined(__alpha__) || defined(__mips__)
32 #  define hidden_def(fct) \
33      asm (".globl " #fct "\n" #fct " = " #fct "_internal");
34 # else
35 #  define hidden_def(fct) \
36      asm (".globl " #fct "\n.set " #fct ", " #fct "_internal");
37 #endif
38 #else
39 # define hidden
40 # define hidden_proto(fct)
41 # define hidden_def(fct)
42 #endif
43
44 #endif
45