Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / ident.h
1 /*
2  * $Id$
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  * Copyright 2006 TRI-D Systems, Inc.
19  */
20
21 #ifndef IDENT_H
22 #define IDENT_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #if defined(__GNUC__)
29 /* force inclusion of ident keywords in the face of optimization */
30 #define RCSID(id) static const char rcsid[] __attribute__ ((used)) = id;
31 #define RCSIDH(h, id) static const char rcsid_ ## h [] __attribute__ ((used)) = id;
32 #elif defined(__SUNPRO_C)
33 /* put ident keyword into comment section (nicer than gcc way) */
34 #define DO_PRAGMA(x) _Pragma(#x)
35 #define RCSID(id) DO_PRAGMA(sun ident id)
36 #define RCSIDH(h, id) DO_PRAGMA(sun ident id)
37 #else
38 #define RCSID(id)
39 #define RCSIDH(h, id)
40 #endif
41
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #endif /* IDENT_H */