freebsd-dev/contrib/awk/gawkmisc.c

71 lines
1.8 KiB
C
Raw Normal View History

1997-10-14 18:17:11 +00:00
/*
* gawkmisc.c --- miscellanious gawk routines that are OS specific.
*/
/*
2001-11-02 21:06:08 +00:00
* Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
1997-10-14 18:17:11 +00:00
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
*
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "awk.h"
2001-11-02 21:06:08 +00:00
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif
1997-10-14 18:17:11 +00:00
/* some old compilers don't grok #elif. sigh */
#if defined(MSDOS) || defined(OS2) || defined(WIN32)
#include "gawkmisc.pc"
2001-11-02 21:06:08 +00:00
#else /* not MSDOS, not OS2, not WIN32 */
1997-10-14 18:17:11 +00:00
#if defined(VMS)
#include "vms/gawkmisc.vms"
2001-11-02 21:06:08 +00:00
#else /* not VMS */
1997-10-14 18:17:11 +00:00
#if defined(atarist)
2001-11-02 21:06:08 +00:00
#include "unsupported/atari/gawkmisc.atr"
#else /* not atarist */
#if defined(TANDEM)
#include "tmiscc"
#else /* not TANDEM */
1997-10-14 18:17:11 +00:00
#include "posix/gawkmisc.c"
2001-11-02 21:06:08 +00:00
#endif /* not TANDEM */
#endif /* not atarist */
#endif /* not VMS */
#endif /* not MSDOS, not OS2, not WIN32 */
1997-10-14 18:17:11 +00:00
/* xmalloc --- provide this so that other GNU library routines work */
#if __STDC__
typedef void *pointer;
#else
typedef char *pointer;
#endif
extern pointer xmalloc P((size_t bytes)); /* get rid of gcc warning */
pointer
2001-11-02 21:06:08 +00:00
xmalloc(size_t bytes)
1997-10-14 18:17:11 +00:00
{
pointer p;
emalloc(p, pointer, bytes, "xmalloc");
return p;
}