source: trunk/include/odincrt.h@ 460

Last change on this file since 460 was 460, checked in by phaller, 26 years ago

Fix: moved ODINCRT.h here

File size: 2.6 KB
RevLine 
[460]1/* $Id: odincrt.h,v 1.1 1999-08-09 21:44:52 phaller Exp $ */
2
3/*
4 * Project Odin Software License can be found in LICENSE.TXT
5 *
6 * 1998/08/09
7 *
8 * Copyright 1998 Patrick Haller
9 */
10
11
12/*****************************************************************************
13 * Name : ORINCRT.H
14 * Purpose : This module maps all VAC++ runtime functions to thread-safe,
15 * Win32-TEB-safe functions.
16 *****************************************************************************/
17
18
19#ifndef __ODIN_H__
20#define __ODIN_H__
21
22
23#ifdef __cplusplus
24 extern "C" {
25#endif
26
27
28/****************************************************************************
29 * Macros *
30 ****************************************************************************/
31
32#define ODINAPI _Export _Optlink
33typedef unsigned short USHORT;
34
35
36#define ODIN_new( V,T)\
37{ \
38 USHORT sel = RestoreOS2FS(); \
39 V = new T; \
40 SetFS(sel);\
41}
42
43#define ODIN_delete( V)\
44{ \
45 USHORT sel = RestoreOS2FS(); \
46 delete V; \
47 SetFS(sel);\
48}
49
50#define ODIN_FS_BEGIN { USHORT sel = RestoreOS2FS();
51#define ODIN_FS_END SetFS(sel); }
52
53
54/****************************************************************************
55 * Internal Prototypes *
56 ****************************************************************************/
57
58void * _debug_calloc ( size_t, size_t, const char *, size_t );
59void _debug_free ( void *, const char *, size_t );
60void * _debug_malloc ( size_t, const char *, size_t );
61void * _debug_realloc( void *, size_t, const char *, size_t );
62
63
64/****************************************************************************
65 * External Prototypes *
66 ****************************************************************************/
67
68USHORT _System GetFS();
69USHORT _System RestoreOS2FS();
70void _System SetFS(USHORT selector);
71USHORT _System SetReturnFS(USHORT selector);
72
73void * ODINAPI ODIN_calloc ( size_t, size_t );
74void ODINAPI ODIN_free ( void * );
75void * ODINAPI ODIN_malloc ( size_t );
76void * ODINAPI ODIN_realloc ( void *, size_t );
77void * ODINAPI ODIN_debug_calloc ( size_t, size_t, const char *, size_t );
78void ODINAPI ODIN_debug_free ( void *, const char *, size_t );
79void * ODINAPI ODIN_debug_malloc ( size_t, const char *, size_t );
80void * ODINAPI ODIN_debug_realloc( void *, size_t, const char *, size_t );
81
82
83char* ODINAPI ODIN_strdup ( const char * );
84
85
86//@@@PH ODIN_new(myClass, ##myParams) new ....
87//@@@PH ODIN_delete(myObject) ... delete myObject ...
88
89#ifdef __cplusplus
90 }
91#endif
92
93#endif /* __ODIN_H_ */
94
Note: See TracBrowser for help on using the repository browser.