; This Macro was removed from sysmsg.inc. We had to remove this
; macro and put it into it's own include file in order to clear up
; some assembly errors. MS MASM will not allow a public declaration
; during the second pass of the assembler. IBM MASM will allow this.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;	$M_DECLARE	     Macro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; NASM original macros

%imacro $M_DECLARE 1
   %iassign $M_DCOUNT 0
   %rep %1
     %iassign $M_DCOUNT $M_DCOUNT + 1
     $M_DECLARE2 $M_DCOUNT
   %endrep

  %IF COMR
	EXTRN	$M_RT2:BYTE
  %ELSE
	EXTRN	$M_RT:BYTE
  %ENDIF

  $M_CHECK $M_MSGSERV_1		      ;  If this subroutine is not in this assembly,
  $M_CHECK $M_MSGSERV_2		      ;  If this subroutine is not in this assembly,
%endmacro

%imacro $M_DECLARE2 1
  %IFN COMR				 ; IF Not resident COMMAND.COM
    %IFN COMT				 ; IF Not transient COMMAND.COM
	%IF	FARmsg
	  EXTRN   $M_CLS_%1:FAR
	%ELSE
	  EXTRN   $M_CLS_%1:NEAR
	%ENDIF
    %ELSE				 ; ELSE
      %ifnidni  $M_CLS_%1, $M_CLS_1	 ; IF NOT $M_CLS_1 or
	%ifnidni $M_CLS_%1, $M_CLS_2	 ;   IF NOT $M_CLS_2 then
	    %IF	    FARmsg		 ;
	      EXTRN   $M_CLS_%1:FAR
	    %ELSE			 ;
	      EXTRN   $M_CLS_%1:NEAR
	    %ENDIF			 ;
	%ENDIF				 ;
      %ENDIF				 ;
    %ENDIF				 ;
  %ELSE					 ; ELSE
    %ifnidni  $M_CLS_%1, $M_CLS_1	 ; IF NOT $M_CLS_1 or
      %ifnidni $M_CLS_%1, $M_CLS_2	 ;   IF NOT $M_CLS_2 then
	    %IF	    FARmsg		 ;
	      EXTRN   $M_CLS_%1:FAR
	    %ELSE			 ;
	      EXTRN   $M_CLS_%1:NEAR
	    %ENDIF			 ;
      %ENDIF				 ;
    %ENDIF				 ;
  %ENDIF			       ;
%ENDMacro			       ;
				       ;
%imacro $M_CHECK 1
    %IF	    FARmsg		       ;
      EXTRN   %1:FAR		       ;    Must be external
    %ELSE			       ;
      EXTRN   %1:NEAR		       ;    Must be external
    %ENDIF			       ;
%ENDMacro			       ;

  $M_DECLARE $M_NUM_CLS		       ;  Declare any class not in this assembly
