xref: /openbsd/sys/arch/alpha/include/cdefs.h (revision 133306f0)
1 /*	$OpenBSD: cdefs.h,v 1.8 2001/01/16 00:08:53 art Exp $	*/
2 /*	$NetBSD: cdefs.h,v 1.5 1996/10/12 18:08:12 cgd Exp $	*/
3 
4 /*
5  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
6  * All rights reserved.
7  *
8  * Author: Chris G. Demetriou
9  *
10  * Permission to use, copy, modify and distribute this software and
11  * its documentation is hereby granted, provided that both the copyright
12  * notice and this permission notice appear in all copies of the
13  * software, derivative works or modified versions, and any portions
14  * thereof, and that both notices appear in supporting documentation.
15  *
16  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19  *
20  * Carnegie Mellon requests users of this software to return to
21  *
22  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
23  *  School of Computer Science
24  *  Carnegie Mellon University
25  *  Pittsburgh PA 15213-3890
26  *
27  * any improvements or extensions that they make and grant Carnegie the
28  * rights to redistribute these changes.
29  */
30 
31 #ifndef _MACHINE_CDEFS_H_
32 #define	_MACHINE_CDEFS_H_
33 
34 #define	_C_LABEL(x)	_STRING(x)
35 
36 #ifdef __ELF__
37 
38 #ifdef __STDC__
39 
40 #define	__weak_alias(alias,sym)						\
41     __asm__(".weak " __STRING(alias) " ; " __STRING(alias) " = " __STRING(sym))
42 #define	__warn_references(sym,msg)					\
43     __asm__(".section .gnu.warning." __STRING(sym) " ; .ascii \"" msg "\" ; .text")
44 
45 #else /* !__STDC__ */
46 
47 #define	__weak_alias(alias,sym)						\
48     __asm__(".weak alias ; alias = sym")
49 #define	__warn_references(sym,msg)					\
50     __asm__(".section .gnu.warning.sym ; .ascii msg ; .text")
51 
52 #endif /* !__STDC__ */
53 
54 #else /* !__ELF__ */
55 
56 /*
57  * We don't support indirect references and don't do anything with warnings.
58  */
59 
60 #ifdef __STDC__
61 #define	__weak_alias(alias,sym)		__asm__(".weakext " __STRING(alias) ", " __STRING(sym))
62 #else /* !__STDC__ */
63 #define	__weak_alias(alias,sym)		__asm__(".weakext alias, sym")
64 #endif /* !__STDC__ */
65 #define	__warn_references(sym,msg)	/* nothing */
66 
67 #endif /* !__ELF__ */
68 
69 #endif /* !_MACHINE_CDEFS_H_ */
70