More section layout code.
[deliverable/binutils-gdb.git] / gold / gold.h
1 // gold.h -- general definitions for gold -*- C++ -*-
2
3 #ifndef GOLD_GOLD_H
4
5 #include "config.h"
6 #include "ansidecl.h"
7
8 #ifdef ENABLE_NLS
9 # include <libintl.h>
10 # define _(String) gettext (String)
11 # ifdef gettext_noop
12 # define N_(String) gettext_noop (String)
13 # else
14 # define N_(String) (String)
15 # endif
16 #else
17 # define gettext(Msgid) (Msgid)
18 # define dgettext(Domainname, Msgid) (Msgid)
19 # define dcgettext(Domainname, Msgid, Category) (Msgid)
20 # define textdomain(Domainname) while (0) /* nothing */
21 # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
22 # define _(String) (String)
23 # define N_(String) (String)
24 #endif
25
26 // Figure out how to get a hash set and a hash map.
27
28 #if HAVE_TR1_UNORDERED_SET && HAVE_TR1_UNORDERED_MAP
29
30 #include <tr1/unordered_set>
31 #include <tr1/unordered_map>
32
33 // We need a template typedef here.
34
35 #define Unordered_set std::tr1::unordered_set
36 #define Unordered_map std::tr1::unordered_map
37
38 #elif HAVE_EXT_HASH_MAP && HAVE_EXT_HASH_SET
39
40 #include <ext/hash_map>
41 #include <ext/hash_set>
42
43 #define Unordered_set __gnu_cxx::hash_set
44 #define Unordered_map __gnu_cxx::hash_map
45
46 #else
47
48 // The fallback is to just use set and map.
49
50 #include <set>
51 #include <map>
52
53 #define Unordered_set std::set
54 #define Unordered_map std::map
55
56 #endif
57
58 namespace gold
59 {
60
61 // The name of the program as used in error messages.
62 extern const char* program_name;
63
64 // This function is called to exit the program. Status is true to
65 // exit success (0) and false to exit failure (1).
66 extern void
67 gold_exit(bool status) ATTRIBUTE_NORETURN;
68
69 // This function is called to emit an unexpected error message and a
70 // newline, and then exit with failure. If PERRNO is true, it reports
71 // the error in errno.
72 extern void
73 gold_fatal(const char* msg, bool perrno) ATTRIBUTE_NORETURN;
74
75 // This is function is called in some cases if we run out of memory.
76 extern void
77 gold_nomem() ATTRIBUTE_NORETURN;
78
79 // This function is called in cases which can not arise if the code is
80 // written correctly.
81 extern void
82 gold_unreachable() ATTRIBUTE_NORETURN;
83
84 } // End namespace gold.
85
86 #endif // !defined(GOLD_GOLD_H)
This page took 0.032741 seconds and 5 git commands to generate.