*BSD News Article 77934


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.sdsmt.edu!news.mid.net!newsfeeder.gi.net!newsfeed.internetmci.com!news.kddnet.ad.jp!sinfony-news!news01.so-net.or.jp!nws830
From: nws830@ca2.so-net.or.jp (Hiroshi Murakami)
Newsgroups: comp.unix.bsd.freebsd.misc,gnu.misc.discuss
Subject: [HOPE] Macro expansion to the FreeBSD f77.
Date: 10 Sep 1996 07:11:02 GMT
Organization: So-net
Lines: 27
Distribution: comp,gnu
Message-ID: <5134a6$bg0@newsgate.so-net.or.jp>
NNTP-Posting-Host: 202.238.111.190
X-Newsreader: mnews [version 1.19] 1995-07/21(Fri)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:26973 gnu.misc.discuss:28672



The fortran compiler f77 in VAX BSD4.x system
have the capability of the cpp-type macro expansions
for the .F suffixed source file as the following

      subroutine sub(a,b,c)
#include "a.inc"
#define KKK_CONST (MMM+4)
#ifdef HUGE_N
      n=NMX_NMX
#else
      n=100
#endif
      ....

I hope the MACRO functionality were available on 
FreeBSD also, since the conditional MACRO mechanism
is quite convenient to take the system restriction
or feature into one united source code.
The include path should be explicitly directed as
% f77 -I../incdir/ a.F a.f 
and also the default MACRO symbol definitions to the 
Fortran code should be different from that of C.

Yes. MACRO feature is the violation of the ANSI fortran standard.
But this helps to coding maintain/test/debug/porting a lot.