(Dynamic Allocation and C): Say global variables are like static.
[glibc.git] / gnu-stabs.h
blob695826f5ab7c8b87914d63b67b266bc2181d7bb5
1 /* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 #ifndef __GNU_STABS_H
21 #define __GNU_STABS_H 1
23 #ifdef HAVE_GNU_LD
25 /* Alias a function:
26 function_alias(creat, _creat, int, (file, mode),
27 DEFUN(creat, (file, mode),
28 CONST char *file AND int mode))
29 Yes, this is very repetitive. Nothing you can do about it, so shut up. */
30 #define function_alias(name, _name, type, args, defun) \
31 symbol_alias (_name, name);
33 #define function_alias_void(name, _name, args, defun) \
34 symbol_alias (_name, name);
36 #ifdef NO_UNDERSCORES
37 #define __SYMBOL_PREFIX
38 #else
39 #define __SYMBOL_PREFIX "_"
40 #endif
42 /* Make references to ALIAS refer to SYMBOL. */
43 #define symbol_alias(symbol, alias) \
44 asm(".stabs \"" __SYMBOL_PREFIX #alias "\",11,0,0,0\n"\
45 ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0")
47 /* Issue a warning message from the linker whenever SYMBOL is referenced. */
48 #define warn_references(symbol, msg) \
49 asm(".stabs \"" msg "\",30,0,0,0\n" \
50 ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0")
52 #define stub_warning(name) \
53 warn_references(name, \
54 "warning: " #name " is not implemented and will always fail")
56 #define text_set_element(set, symbol) \
57 asm(".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
58 #define data_set_element(set, symbol) \
59 asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
60 #define bss_set_element(set, symbol) \
61 asm(".stabs \"" __SYMBOL_PREFIX #set "\",27,0,0," __SYMBOL_PREFIX #symbol)
63 #else /* No GNU stabs. */
65 #define function_alias(name, _name, type, args, defun) \
66 type defun { return _name args; }
68 #define function_alias_void(name, _name, args, defun) \
69 void defun { _name args; }
71 #endif /* GNU stabs. */
73 #endif /* gnu-stabs.h */