1 /* lutil.h -- utilities
3 This file is part of the UCL data compression library.
5 Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
8 The UCL library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 The UCL library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with the UCL library; see the file COPYING.
20 If not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Markus F.X.J. Oberhumer
24 <markus@oberhumer.com>
30 #if !defined(NO_STDLIB_H)
35 #if defined(HAVE_UNISTD_H) || defined(__DJGPP__) || defined(__EMX__)
37 #elif defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__MINGW32__)
40 #if defined(HAVE_STAT)
41 # include <sys/types.h>
42 # include <sys/stat.h>
45 #include <ucl/uclconf.h>
46 #include <ucl/uclutil.h>
49 /* some systems have a xmalloc in their C library... */
58 #define xmalloc my_xmalloc
59 #define xfree my_xfree
62 #define HEAP_ALLOC(var,size) \
63 long __UCL_MMODEL var [ ((size) + (sizeof(long) - 1)) / sizeof(long) ]