Revision 1896 trunk/src/linad99/humung.cpp

humung.cpp (revision 1896)
10 10
 */
11 11
// file fvar.cpp
12 12
// constructors, destructors and misc functions involving class prevariable
13
#define DOS386
14

  
15 13
#include "fvar.hpp"
16 14

  
17
#if (defined(__ZTC__) && !defined(DOS386))
15
#if defined(__ZTC__)
18 16
//  void _far * _cdecl _farptr_norm(void _far *);
19 17
  void _far * _cdecl _farptr_fromlong(unsigned long);
20 18
  long _cdecl _farptr_tolong(void _far *);
......
28 26
{
29 27
  ptr-=adjustment;
30 28
  adjustment=0;
31
  #if (defined(__BORLANDC__))
32
    #if (!defined(DOSX286) && !defined(DOS386))
33
      farfree(ptr);
34
    #else
35
      ::free(ptr);
36
    #endif
37
  #endif
38
  #if (defined(__ZTC__))
39
    #if (!defined(DOS386))
40
      farfree(ptr);
41
    #else
42
      ::free(ptr);
43
    #endif
44
  #endif
45
  #if (!defined(__BORLANDC__)&& !defined(__ZTC__))
46
    ::free(ptr);
47
  #endif
29
#if defined(__BORLANDC__) || defined(__ZTC__)
30
  farfree(ptr);
31
#else
32
  ::free(ptr);
33
#endif
48 34
  ptr=NULL;
49 35
}
50 36

  
......
132 118
// object pointed to
133 119
{
134 120
  humungous_pointer tmp;
135
  #if (defined(__ZTC__) && !defined(DOS386))
121
#if defined(__ZTC__)
136 122
    tmp.ptr=(char*)(_farptr_fromlong(_farptr_tolong(ptr)+offset));
137
  #else
123
#else
138 124
    tmp.ptr=(ptr+offset);
139
  #endif
125
#endif
140 126
  return tmp;
141 127
}
142 128

  
......
149 135
// object pointed to
150 136
{
151 137
  //char * tmp;
152
  #if (defined(__ZTC__) && !defined(DOS386))
138
#if defined(__ZTC__)
153 139
    ptr=(char*)(_farptr_fromlong(_farptr_tolong(ptr)+offset));
154
  #else
140
#else
155 141
    ptr=(ptr+offset);
156
  #endif
142
#endif
157 143
  return *this;
158 144
}
159 145

  
......
163 149
 */
164 150
humungous_pointer& humungous_pointer::operator = (void * p)
165 151
{
166
  #if defined(__BORLANDC__) && !defined(DOS386)
152
#if defined(__BORLANDC__)
167 153
    ptr = (char huge *) p;
168
  #else
154
#else
169 155
    ptr = (char *) p;
170
  #endif
156
#endif
171 157
  return *this;
172 158
}

Also available in: Unified diff