Skip to content

Commit

Permalink
wlink separate Windows formats from OS/2 formats
Browse files Browse the repository at this point in the history
Now MK_OS2... macros doesn't include any MK_WIN... macros
rename macro MK_WINDOWS to MK_WIN_NE
remove macros which separate MK_WIN... macros from MK_OS2... macros
now only following macros are defined for OS/2 formats
MK_OS2_NE
MK_OS2_LE
MK_OS2_LX
MK_OS2_FLAT
MK_OS2
following Windows macros are defined as standalone and is not combined with other macros
MK_WIN_NE
MK_WIN_VXD
  • Loading branch information
jmalak committed Dec 31, 2023
1 parent eafccce commit ec59b77
Show file tree
Hide file tree
Showing 21 changed files with 176 additions and 179 deletions.
4 changes: 2 additions & 2 deletions bld/wl/c/autogrp.c
Expand Up @@ -71,8 +71,8 @@ static offset GetSegGroupPackLimit( seg_leader *seg )
}
if( seg->info & USE_32 ) {
limit = 0xFFFFFFFF;
} else if( FmtData.type & MK_WINDOWS ) { /* windows doesn't like */
limit = 0xFFF0; /* large code segments */
} else if( FmtData.type & MK_WIN_NE ) { /* windows doesn't like */
limit = 0xFFF0; /* large code segments */
} else {
limit = 0xFFFF;
}
Expand Down
48 changes: 24 additions & 24 deletions bld/wl/c/cmdall.c
Expand Up @@ -983,7 +983,7 @@ static char **getStubNamePtr( void )
/**********************************/
{
#ifdef _OS2
if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) {
if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) {
return( &FmtData.u.os2fam.stub_file_name );
}
#endif
Expand Down Expand Up @@ -1383,7 +1383,7 @@ static bool ProcImport( void )
/****************************/
{
#ifdef _OS2
if( HintFormat( MK_OS2 | MK_PE ) ) {
if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE ) ) {
return( ProcOS2Import() );
}
#endif
Expand All @@ -1404,7 +1404,7 @@ static bool ProcExport( void )
/****************************/
{
#ifdef _OS2
if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) {
if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) {
return( ProcOS2Export() );
}
#endif
Expand Down Expand Up @@ -1455,7 +1455,7 @@ static bool ProcSegment( void )
/*****************************/
{
#ifdef _OS2
if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) {
if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) {
return( ProcOS2Segment() );
}
#endif
Expand All @@ -1473,7 +1473,7 @@ static bool ProcAlignment( void )
/*******************************/
{
#ifdef _OS2
if( HintFormat( MK_OS2_16BIT | MK_OS2_LX | MK_PE ) ) {
if( HintFormat( MK_OS2_NE | MK_WIN_NE | MK_OS2_LX | MK_PE ) ) {
return( ProcOS2Alignment() );
}
#endif
Expand All @@ -1496,7 +1496,7 @@ static bool ProcHeapSize( void )
}
#endif
#ifdef _OS2
if( HintFormat( MK_OS2 | MK_PE ) ) {
if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE ) ) {
return( ProcOS2HeapSize() );
}
#endif
Expand Down Expand Up @@ -1535,7 +1535,7 @@ static bool ProcOffset( void )
}
#endif
//#ifdef _OS2
// if( FmtData.type & (MK_OS2 | MK_PE) ) {
// if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE) ) {
// ChkBase( _64K );
// return( true );
// }
Expand Down Expand Up @@ -1956,28 +1956,28 @@ static parse_entry MainOptions[] = {
"INCremental", ProcIncremental, MK_ALL, 0,
"FILLchar", ProcFillchar, MK_ALL, 0,
#if defined( _OS2 ) || defined( _EXE ) || defined( _DOS16M ) || defined( _QNX )
"PACKCode", ProcPackcode, (MK_OS2_16BIT | MK_DOS | MK_QNX | MK_DOS16M), 0,
"PACKData", ProcPackdata, (MK_OS2_16BIT | MK_DOS | MK_QNX | MK_DOS16M), 0,
"PACKCode", ProcPackcode, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX | MK_DOS16M), 0,
"PACKData", ProcPackdata, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX | MK_DOS16M), 0,
#endif
#if defined( _OS2 ) || defined( _ELF )
"Alignment", ProcAlignment, (MK_OS2_16BIT | MK_OS2_LX | MK_PE | MK_ELF), 0,
"Alignment", ProcAlignment, (MK_OS2_NE | MK_WIN_NE | MK_OS2_LX | MK_PE | MK_ELF), 0,
#endif
#if defined( _OS2 ) || defined( _PHARLAP ) || defined( _DOS16M )
"STUB", ProcStub, (MK_OS2 | MK_PE | MK_WIN_VXD | MK_PHAR_LAP | MK_DOS16M), 0,
"STUB", ProcStub, (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD | MK_PHAR_LAP | MK_DOS16M), 0,
#endif
#if defined( _OS2 ) || defined( _NOVELL )
"DEscription", ProcDescription, MK_OS2 | MK_PE | MK_WIN_VXD | MK_NOVELL, 0,
"DEscription", ProcDescription, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD | MK_NOVELL, 0,
#endif
#if defined( _OS2 ) || defined( _QNX )
"Heapsize", ProcHeapSize, (MK_OS2 | MK_QNX | MK_PE), 0,
"Heapsize", ProcHeapSize, (MK_OS2 | MK_WIN_NE | MK_QNX | MK_PE), 0,
#endif
#if defined(_PHARLAP) || defined(_QNX) || defined(_OS2) || defined(_RAW)
"OFFset", ProcOffset, MK_PHAR_FLAT | MK_OS2_FLAT | MK_PE | MK_QNX_FLAT | MK_ELF | MK_RAW, 0,
"OFFset", ProcOffset, MK_PHAR_FLAT | MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_QNX_FLAT | MK_ELF | MK_RAW, 0,
#endif
#if defined( _OS2 ) || defined( _NOVELL )
"VERSion", ProcVersion, MK_NOVELL | MK_OS2_FLAT | MK_PE | MK_WINDOWS, 0,
"IMPLib", ProcImplib, MK_NOVELL | MK_OS2 | MK_PE, 0,
"IMPFile", ProcImpFile, MK_NOVELL | MK_OS2 | MK_PE, 0,
"VERSion", ProcVersion, MK_NOVELL | MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_WIN_NE, 0,
"IMPLib", ProcImplib, MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE, 0,
"IMPFile", ProcImpFile, MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE, 0,
#endif
#if defined( _DOS16M ) || defined( _QNX ) || defined( _OS2 ) || defined( _ELF )
"NORelocs", ProcNoRelocs, (MK_QNX | MK_DOS16M | MK_PE | MK_ELF), 0,
Expand Down Expand Up @@ -2047,8 +2047,8 @@ static parse_entry Models[] = {
"Dos", ProcDosFormat, MK_DOS, 0,
#endif
#ifdef _OS2
"OS2", ProcOS2Format, MK_ONLY_OS2, 0,
"WINdows", ProcWindowsFormat, MK_WINDOWS | MK_PE | MK_WIN_VXD, 0,
"OS2", ProcOS2Format, MK_OS2, 0,
"WINdows", ProcWindowsFormat, MK_WIN_NE | MK_PE | MK_WIN_VXD, 0,
#endif
#ifdef _PHARLAP
"PHARlap", ProcPharFormat, MK_PHAR_LAP, 0,
Expand Down Expand Up @@ -2118,14 +2118,14 @@ static parse_entry Directives[] = {
#ifdef _OS2
"RESource", ProcResource, MK_PE, 0,
"COMmit", ProcCommit, MK_PE, 0,
"ANONymousexport",ProcAnonExport, MK_OS2, CF_AFTER_INC,
"ANONymousexport",ProcAnonExport, MK_OS2 | MK_WIN_NE, CF_AFTER_INC,
#endif
#if defined( _NOVELL ) || defined( _OS2 ) || defined( _ELF )
"IMPort", ProcImport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_PE), CF_AFTER_INC,
"EXPort", ProcExport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_PE | MK_WIN_VXD), CF_AFTER_INC,
"IMPort", ProcImport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_WIN_NE | MK_PE), CF_AFTER_INC,
"EXPort", ProcExport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD), CF_AFTER_INC,
#endif
#if defined( _OS2 ) || defined( _QNX )
"SEGment", ProcSegment, (MK_QNX | MK_OS2 | MK_PE | MK_WIN_VXD ), CF_SUBSET,
"SEGment", ProcSegment, (MK_QNX | MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ), CF_SUBSET,
#endif
#ifdef _EXE
"OVerlay", ProcOverlay, MK_OVERLAYS, 0,
Expand All @@ -2146,7 +2146,7 @@ static parse_entry Directives[] = {
"TRansparent", Proc16MTransparent, MK_DOS16M, CF_SUBSET,
#endif
#if defined( _OS2 ) || defined( _EXE ) || defined ( _QNX )
"NEWsegment", ProcNewSegment, (MK_OS2_16BIT | MK_DOS | MK_QNX), 0,
"NEWsegment", ProcNewSegment, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX), 0,
#endif
#ifdef DEVBUILD
"Xdbg", ProcXDbg, MK_ALL, 0,
Expand Down
14 changes: 7 additions & 7 deletions bld/wl/c/cmdline.c
Expand Up @@ -104,7 +104,7 @@ static const select_format PossibleFmt[] = {
MK_ELF, "LIBELF", SetELFFmt, FreeELFFmt,
#endif
#ifdef _OS2
MK_WINDOWS, "LIBWIN", SetOS2Fmt, FreeOS2Fmt,
MK_WIN_NE, "LIBWIN", SetOS2Fmt, FreeOS2Fmt,
MK_OS2_NE, "LIBOS2", SetOS2Fmt, FreeOS2Fmt,
MK_OS2_LE, "LIBOS2FLAT", SetOS2Fmt, FreeOS2Fmt,
MK_OS2_LX, "LIBOS2FLAT", SetOS2Fmt, FreeOS2Fmt,
Expand Down Expand Up @@ -327,17 +327,17 @@ void DoCmdFile( const char *fname )
if( (LinkState & LS_FMT_DECIDED) == 0 ) {
/* restrict set to automatically decided ones */
#if defined( __QNX__ )
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_QNX )
#define LAST_CHANCE ( MK_OS2 | MK_QNX )
#elif defined( __LINUX__ )
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_ELF )
#define LAST_CHANCE ( MK_OS2 | MK_ELF )
#elif defined( __BSD__ )
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_ELF )
#define LAST_CHANCE ( MK_OS2 | MK_ELF )
#elif defined( __NT__ )
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_NE | MK_WINDOWS | MK_PE | MK_DOS_EXE | MK_WIN_VXD )
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_NE | MK_WIN_NE | MK_PE | MK_DOS_EXE | MK_WIN_VXD )
#elif defined( __RDOS__ )
#define LAST_CHANCE ( MK_RDOS | MK_PE | MK_DOS_EXE)
#else
#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_DOS_EXE | MK_PHAR_SIMPLE )
#define LAST_CHANCE ( MK_OS2 | MK_DOS_EXE | MK_PHAR_SIMPLE )
#endif
HintFormat( LAST_CHANCE );
} else {
Expand Down Expand Up @@ -492,7 +492,7 @@ bool HintFormat( exe_format hint )
}
if( possible == 0 ) {
#ifdef _OS2
if( (~(MK_OS2 | MK_PE | MK_WIN_VXD) & FmtData.type) == 0 ) {
if( (~(MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) & FmtData.type) == 0 ) {
/* Windows, OS/2 V1.x, OS/2 V2.x, PE, VxD all
want the same structure */
InitFmt( SetOS2Fmt );
Expand Down

0 comments on commit ec59b77

Please sign in to comment.