Skip to content

Commit

Permalink
[project @ 1999-01-23 17:51:27 by sof]
Browse files Browse the repository at this point in the history
Added comment next to the I*_ macros to explain why having them
expand to use 'static' instead of 'extern' is a Really Bad Idea.
  • Loading branch information
sof committed Jan 23, 1999
1 parent b97d46a commit 706f5ed
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ghc/includes/StgMacros.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
* $Id: StgMacros.h,v 1.3 1999/01/21 10:31:43 simonm Exp $
* $Id: StgMacros.h,v 1.4 1999/01/23 17:51:27 sof Exp $
*
* Macros used for writing STG-ish C code.
*
Expand All @@ -22,16 +22,28 @@
The macros can be used either to define the function itself, or to provide
prototypes (by following with a ';').
Note: the various I*_ shorthands in the second block below are used to
declare forward references to local symbols. These shorthands *have* to
use the 'extern' type specifier and not 'static'. The reason for this is
that 'static' declares a reference as being a static/local variable,
and *not* as a forward reference to a static variable.
This might seem obvious, but it had me stumped as to why my info tables
were suddenly all filled with 0s.
-- sof 1/99
--------------------------------------------------------------------------- */

#define STGFUN(f) StgFunPtr f(void)
#define STATICFUN(f) static StgFunPtr f(void)
#define EXTFUN(f) extern StgFunPtr f(void)

#define FN_(f) F_ f(void)
#define IFN_(f) static F_ f(void)
#define IF_(f) static F_ f(void)
#define EF_(f) extern F_ f(void)

#define ED_ extern
#define ED_RO_ extern const
#define ID_ extern
Expand Down

0 comments on commit 706f5ed

Please sign in to comment.