Introduced -devel and -extras subpackages for gawk
[platform/upstream/gawk.git] / gawkmisc.c
1 /*
2  * gawkmisc.c --- miscellanious gawk routines that are OS specific.
3  */
4
5 /* 
6  * Copyright (C) 1986, 1988, 1989, 1991-2004, 2010, 2011
7  * the Free Software Foundation, Inc.
8  * 
9  * This file is part of GAWK, the GNU implementation of the
10  * AWK Programming Language.
11  * 
12  * GAWK is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  * 
17  * GAWK is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
25  */
26
27 #include "awk.h"
28
29 #if defined(HAVE_FCNTL_H)
30 #include <fcntl.h>
31 #endif
32
33 /* some old compilers don't grok #elif. sigh */
34
35 #if defined(__EMX__) || defined(__DJGPP__) || defined(__MINGW32__)
36 #include "pc/gawkmisc.pc"
37 #else /* not __DJGPP__, not __MINGW32__ */
38 #if defined(VMS)
39 #include "vms/gawkmisc.vms"
40 #else /* not VMS */
41 #include "posix/gawkmisc.c"
42 #endif /* not VMS */
43 #endif /* not __DJGPP__, not __MINGW32__ */
44
45 /* xmalloc --- provide this so that other GNU library routines work */
46
47 typedef void *pointer;
48
49 extern pointer xmalloc(size_t bytes);   /* get rid of gcc warning */
50
51 pointer
52 xmalloc(size_t bytes)
53 {
54         pointer p;
55         emalloc(p, pointer, bytes, "xmalloc");
56         return p;
57 }