My variant of incresing macrolib flexibility and abilities, only basic improvements realised : as Win16-32-64 universality and more classes to macros added, that's possible turn on and off by one, and even by name of each macro, using mlib and nomlib command lline options

And that not to make substitiutes for microlib names, maybe better to change code searching symbols :
cmdline.c :
line 42 :
#include "macrolib.h"
line 410 :
static void OPTQUAL Set_NOMLIB(void)
{
#if defined ML_SWN
if (*OptName) noAutoMacrosAdd(OptName + 1);
else
#endif
Options.nomlib = TRUE;
}
static void OPTQUAL Set_MLIB(void)
{
#if defined ML_SWN
if (*OptName) inAutoMacrosAdd(OptName + 1);
else
#endif
Options.nomlib = FALSE;
}
line 611 :
{ "nomlib=@", 0, Set_NOMLIB },
{ "mlib=@", 0, Set_MLIB },
expans.c
line 1164 : for invariant to register macro names
if( tokenarray[i].token == T_ID || tokenarray[i].token == T_INSTRUCTION) {line 1168 : for invariant to register macro names
sym = SymFindDeclare(tokenarray[i].string_ptr);
else
#ifdef __SW_BD
sym = SymFindToken(tokenarray[i].string_ptr, tokenarray[i].token);
#else
sym = SymSearch( tokenarray[i].string_ptr );
#endifsymbols.c
line 309 : for invariant to register macro names
#ifdef __SW_BD
struct asym *SymFindToken( const char *name, int token)
/**************************************/
/* find a symbol in the local/global symbol table,
* FOR REPLACE INSTRUCTIONS BY MACROSES
* return ptr to next free entry in global table if not found.
* Note: lsym must be global, thus if the symbol isn't
* found and is to be added to the local table, there's no
* second scan necessary.
*/
{
int i;
int len;
len = strlen( name );
i = hashpjw( name );
if ( CurrProc ) {
for( lsym = &lsym_table[ i % LHASH_TABLE_SIZE ]; *lsym; lsym = &((*lsym)->nextitem ) ) {
if ( len == (*lsym)->name_size && SYMCMP( name, (*lsym)->name, len ) == 0 ) {
DebugMsg1(("SymFind(%s): found in local table, state=%u, local=%u\n", name, (*lsym)->state, (*lsym)->scoped ));
(*lsym)->used = TRUE;
return( *lsym );
}
}
}
for( gsym = &gsym_table[ i % GHASH_TABLE_SIZE ]; *gsym; gsym = &((*gsym)->nextitem ) ) {
if ( len == (*gsym)->name_size && ((token == T_INSTRUCTION && (*gsym)->state == SYM_MACRO) ? (_memicmp(name, (*gsym)->name, len) == 0) : (SYMCMP(name, (*gsym)->name, len) == 0)) ) {
DebugMsg1(("SymFind(%s): found, state=%u memtype=%X lang=%u\n", name, (*gsym)->state, (*gsym)->mem_type, (*gsym)->langtype ));
return( *gsym );
}
}
return( NULL );
}
#endif