🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2711

#define thisneatmacro

#2711
From: LAUGHLIN, CHET
Date: Thu, 18 Oct 1990 20:10
33 lines
1471 bytes
I have a function that is called all the time by my screen handling
routines in a program.  I'm not sure if TC is placing the two liner
function inline even though I've set it for speed (vs. size) optimizing.
I have been unable to write the function as a macro for all situations-
possibly somebody knows a hack?

static void drawch(x,y,ch)
  int x,y;
  char ch;
{
  gotoxy(x,y);
  cput(ch);
}

I tried useing the following macro, with some success...

#define drawch(A,B,C)  {gotoxy(A,B); cput(C);}

however, the following code won't work...compiler doesn't like
the extra ; at the end of drawch...

if (cond)
   drawch(x,y,ch);
else
   printf("ICK!\n");

Any ideas out there?
+---------------------------------------------------------------+
| Chet Laughlin                  CTL8588@RIGEL.TAMU.EDU         |
|   "I have no opinions as I          (128.194.4.4)             |
|    do not exist, my lawyers                                   |
|    told me so."                                               |
+---------------------------------------------------------------+
Technical Details
Message-ID: <9286@helios.TAMU.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!rigel.tamu.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!rigel.tamu.edu
From: ctl8588@rigel.tamu.edu (LAUGHLIN, CHET)
Newsgroups: comp.os.msdos.programmer
Subject: #define thisneatmacro
Message-ID: <9286@helios.TAMU.EDU>
Date: 18 Oct 90 20:10:01 GMT
Sender: news@helios.TAMU.EDU
Reply-To: ctl8588@rigel.tamu.edu
Organization: TAMU
Lines: 33