Article View: comp.os.msdos.programmer
Article #765Problem with TCC/BCC and macro definitions
From: Jeremy DuBois
Date: Thu, 16 Apr 1992 03:27
Date: Thu, 16 Apr 1992 03:27
38 lines
2104 bytes
2104 bytes
Hi guys/gals, My father has run into a problem upgrading from Turbo C to
Turbo C++. Yeah, I know upgrading to Turbo C++ instead of Borland C++ is a
little silly, but you know these old-timers ;)
Anyway, here is the problem. He's got a lot of #defined macro functions
in his programs, and he calls them with parameters that are also #defines.
This works fine unless he trys to pass more than one parameter as a single
#define. Here's an sample of code that won't preprocess:
-------
#include <stdio.h>
#define MACROFUNC(x,y) x+y
#define MACROPARAM 5,1
void main()
{
printf("%d\n",MACROFUNC(MACROPARAM));
}
-------
Now he claims the Turbo C used to let him do this, but Turbo C++ says
that there aren't enough parameters to the macro function call.
I tested it with my copy of Borland C++, and with sun's cc, and gcc on the
universities sun 4's, and they all behave the same way as Turbo C++ (i.e.
they won't compile.)
Finally, my question is: Does anybody know if there is a way to make Turbo
and/or Borland C++ to act like the old Turbo C and compile this, or does my
father have to go and change all of his source code to work with Turbo C++?
Thanks for any help you can provide.
--
/ Jeremy DuBois \
-----------------------------------------------------------------------
| dubs_cif@uhura.cc.rochester.edu | University of Rochester, New York |
-----------------------------------------------------------------------
Technical Details
Message-ID:
<1992Apr16.032726.14417@galileo.cc.rochester.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!swrinde!gatech!rutgers!ub!galileo.cc.rochester.edu!troi.cc.rochester.edu!dubs_cifShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!swrinde!gatech!rutgers!ub!galileo.cc.rochester.edu!troi.cc.rochester.edu!dubs_cif From: dubs_cif@troi.cc.rochester.edu (Jeremy DuBois) Newsgroups: comp.os.msdos.programmer Subject: Problem with TCC/BCC and macro definitions Summary: A problem with defining macro functions in TCC and BCC Keywords: TCC Turbo Borland problem macros C Message-ID: <1992Apr16.032726.14417@galileo.cc.rochester.edu> Date: 16 Apr 92 03:27:26 GMT Sender: news@galileo.cc.rochester.edu Organization: University of Rochester - Rochester, New York Lines: 38 Nntp-Posting-Host: troi.cc.rochester.edu