Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / awk / gawkmisc.c
1 /*
2  * gawkmisc.c --- miscellanious gawk routines that are OS specific.
3  */
4
5 /* 
6  * Copyright (C) 1986, 1988, 1989, 1991-2000 the Free Software Foundation, Inc.
7  * 
8  * This file is part of GAWK, the GNU implementation of the
9  * AWK Programming Language.
10  * 
11  * GAWK is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  * 
16  * GAWK is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
24  */
25
26 #include "awk.h"
27
28 /* some old compilers don't grok #elif. sigh */
29
30 #if defined(MSDOS) || defined(OS2) || defined(WIN32)
31 #include "gawkmisc.pc"
32 #else
33 #if defined(VMS)
34 #include "vms/gawkmisc.vms"
35 #else
36 #if defined(atarist)
37 #include "atari/gawkmisc.atr"
38 #else
39 #include "posix/gawkmisc.c"
40 #endif
41 #endif
42 #endif
43
44 /* xmalloc --- provide this so that other GNU library routines work */
45
46 #if __STDC__
47 typedef void *pointer;
48 #else
49 typedef char *pointer;
50 #endif
51
52 extern pointer xmalloc P((size_t bytes));       /* get rid of gcc warning */
53
54 pointer
55 xmalloc(bytes)
56 size_t bytes;
57 {
58         pointer p;
59
60         emalloc(p, pointer, bytes, "xmalloc");
61
62         return p;
63 }