Skip to content

Commit 4afdf3f

Browse files
author
hr
committed
initial import
0 parents  commit 4afdf3f

File tree

494 files changed

+52571
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+52571
-0
lines changed

alloc.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/* RCS $Id: alloc.h,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
2+
--
3+
-- SYNOPSIS
4+
-- Macros for allocating memory.
5+
--
6+
-- DESCRIPTION
7+
-- A somewhat nicer interface to malloc and calloc.
8+
-- Here we standardise the calling convention with a common macro
9+
-- interface.
10+
--
11+
-- AUTHOR
12+
-- Dennis Vadura, [email protected]
13+
--
14+
-- WWW
15+
-- http://dmake.wticorp.com/
16+
--
17+
-- COPYRIGHT
18+
-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
19+
--
20+
-- This program is NOT free software; you can redistribute it and/or
21+
-- modify it under the terms of the Software License Agreement Provided
22+
-- in the file <distribution-root>/readme/license.txt.
23+
--
24+
-- LOG
25+
-- Use cvs log to obtain detailed change logs.
26+
*/
27+
28+
#ifndef ALLOC_h
29+
#define ALLOC_h
30+
31+
/* DO NOT CHANGE these! These are the definitions that the make source
32+
* uses for allocating memory. They must be defined for make to compile
33+
* properly.
34+
*/
35+
36+
/* This is the only place that we define size_t now. This should be more
37+
* than enough! */
38+
#if __STDC__
39+
#else
40+
# if !defined(_TYPES_) && !defined(M_XENIX) && !defined(atarist) && !defined(_MPW) && !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(__size_t) && !defined(_WIN32)
41+
# if defined(MSDOS) || defined(__MSDOS__)
42+
# undef size_t
43+
typedef unsigned size_t;
44+
# else
45+
typedef long size_t;
46+
# endif
47+
# endif
48+
#endif
49+
50+
#define usizeof(t) (size_t)sizeof(t)
51+
52+
#define FREE(p) free((char*)(p))
53+
#define MALLOC(n, t) (t*) malloc((unsigned int)(n)*usizeof(t))
54+
#define CALLOC(n, t) (t*) calloc((unsigned int)(n), usizeof(t))
55+
56+
#define TALLOC(p, n, t) if ((p = CALLOC(n, t)) == (t*)0) {No_ram();}
57+
58+
#endif
59+

0 commit comments

Comments
 (0)