- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
148 lines
3.8 KiB
C++
148 lines
3.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// ObjectSupport
|
|
// (C) Copyright 1993, 1994 by Borland International, All Rights Reserved
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
#if !defined(OSL_DEFS_H)
|
|
#define OSL_DEFS_H
|
|
|
|
#if !defined(CLASSLIB_DEFS_H)
|
|
# include <classlib/defs.h>
|
|
#endif
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
// Include windows.h, if indicated, with necessary macros defined
|
|
//
|
|
|
|
#if defined(BI_PLAT_WIN32) && !defined(_OLEAUTO_H_)
|
|
//
|
|
// NOTE: 'tagCY' seems to undergo several changes [from struct to union,
|
|
// then to union containing a struct] making it hard to properly
|
|
// choose between inheritance and containment.
|
|
// The following approach ensures the it can be used as a base class.
|
|
//
|
|
#ifndef _tagCY_DEFINED
|
|
#define _tagCY_DEFINED
|
|
#define _CY_DEFINED
|
|
/* size is 8 */
|
|
typedef struct tagCY
|
|
{
|
|
unsigned long Lo;
|
|
long Hi;
|
|
} CY;
|
|
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(BI_PLAT_MSW)
|
|
# if defined(__WINDOWS_H) && !defined(INC_WINDOWS)
|
|
# if !defined(STRICT)
|
|
# error if windows.h is included before osl/defs.h, STRICT must be defined
|
|
# endif
|
|
# else
|
|
# define STRICT
|
|
# if defined(BI_NO_BOOL) && defined(EMULATE_BOOL)
|
|
# define BOOL WBOOL
|
|
# include <windows.h>
|
|
# undef BOOL // redefine Windows BOOL in terms of the bool type
|
|
# define BOOL bool
|
|
# undef FALSE
|
|
# define FALSE false
|
|
# undef TRUE
|
|
# define TRUE true
|
|
# else
|
|
# include <windows.h>
|
|
# endif
|
|
# endif
|
|
# if !defined(__SHELLAPI_H) && !defined(_INC_SHELLAPI) && !defined(BI_PLAT_WIN32)
|
|
# include <shellapi.h>
|
|
# endif
|
|
# if defined(BI_PLAT_WIN16) && defined(INC_OLE2)
|
|
# if !defined(__OLE2_H) && !defined(_OLE2_H_)
|
|
# include <ole2.h>
|
|
# endif
|
|
# if !defined(__DISPATCH_H)
|
|
# include <dispatch.h>
|
|
# endif
|
|
# if !defined(__OLENLS_H) && !defined(_OLENLS_)
|
|
# include <olenls.h>
|
|
# endif
|
|
# endif
|
|
#endif
|
|
|
|
//
|
|
// Some nonfixed-size types defined similar to the fixedsize in systypes.h
|
|
//
|
|
typedef unsigned long ulong;
|
|
typedef unsigned int uint;
|
|
typedef unsigned short ushort;
|
|
|
|
//
|
|
// Shorthand 'far' keyword evaluates to __far when needed & supported, else
|
|
// nothing
|
|
//
|
|
#if !defined(far)
|
|
# if defined(BI_PTR_0_32)
|
|
# define far
|
|
# else
|
|
# define far __far
|
|
# endif
|
|
#endif
|
|
#if defined(BI_NO_BOOL) && defined(EMULATE_BOOL)
|
|
template<class T> inline bool ToBool(const T& t) {
|
|
return static_cast<bool>(t != 0);
|
|
}
|
|
#else
|
|
template<class T> inline bool ToBool(const T& t) {
|
|
return static_cast<bool>(t);
|
|
}
|
|
#endif
|
|
|
|
//
|
|
// Current module instance in RTL (PLAT_WIN16) or OSL (PLAT_WIN32)
|
|
//
|
|
extern __cdecl HINSTANCE _hInstance;
|
|
|
|
//
|
|
// Class encapsulations for 64 bit signed and unsigned integers compatible
|
|
// with Ole2 and Win32 structs
|
|
//
|
|
#if !defined(__SYSTYPES_H)
|
|
# include <systypes.h> // int8, int16, etc.
|
|
#endif
|
|
|
|
#if defined(BI_PLAT_WIN32)
|
|
union _ULARGE_INTEGER;
|
|
union _LARGE_INTEGER;
|
|
#else
|
|
class far _ULARGE_INTEGER;
|
|
class far _LARGE_INTEGER;
|
|
#endif
|
|
|
|
class uint64 {
|
|
public:
|
|
uint64(uint32 low, uint32 high) {LowPart = low; HighPart = high;}
|
|
uint64() {LowPart = HighPart = 0;}
|
|
uint64(_ULARGE_INTEGER uli) {*(_ULARGE_INTEGER*)this = uli;}
|
|
operator _ULARGE_INTEGER() const {return *(_ULARGE_INTEGER*)this;}
|
|
|
|
uint32 LowPart;
|
|
uint32 HighPart;
|
|
};
|
|
|
|
class int64 {
|
|
public:
|
|
int64(uint32 low, long high) {LowPart = low; HighPart = high;}
|
|
int64(long low) {LowPart = low; HighPart = low<0 ? -1 : 0;}
|
|
int64() {LowPart = HighPart = 0;}
|
|
int64(_LARGE_INTEGER li) {*(_LARGE_INTEGER*)this = li;}
|
|
operator _LARGE_INTEGER() const {return *(_LARGE_INTEGER*)this;}
|
|
|
|
uint32 LowPart;
|
|
int32 HighPart;
|
|
};
|
|
|
|
#endif // OSL_DEFS_H
|