Commit cace43e1 authored by simonmar's avatar simonmar
Browse files

[project @ 2005-02-01 14:14:41 by simonmar]

Add __attribute__((used)) to static functions, as gcc 3.4 -O2 is in the
habit of throwing them away.
parent 9dadfbd7
...@@ -38,20 +38,6 @@ extern "C" { ...@@ -38,20 +38,6 @@ extern "C" {
#define __MSVCRT__ 1 #define __MSVCRT__ 1
#endif #endif
#if defined(__GNUC__)
#define GNU_ATTRIBUTE(at) __attribute__((at))
#else
#define GNU_ATTRIBUTE(at)
#endif
#if __GNUC__ >= 3
#define GNUC3_ATTRIBUTE(at) __attribute__((at))
#else
#define GNUC3_ATTRIBUTE(at)
#endif
#define STG_UNUSED GNUC3_ATTRIBUTE(__unused__)
/* /*
* We often want to know the size of something in units of an * We often want to know the size of something in units of an
* StgWord... (rounded up, of course!) * StgWord... (rounded up, of course!)
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: Stg.h,v 1.66 2005/01/28 12:55:52 simonmar Exp $ * $Id: Stg.h,v 1.67 2005/02/01 14:14:41 simonmar Exp $
* *
* (c) The GHC Team, 1998-2004 * (c) The GHC Team, 1998-2004
* *
...@@ -81,6 +81,23 @@ ...@@ -81,6 +81,23 @@
# error "Don't know how to inline functions with your C compiler." # error "Don't know how to inline functions with your C compiler."
#endif #endif
/*
* GCC attributes
*/
#if defined(__GNUC__)
#define GNU_ATTRIBUTE(at) __attribute__((at))
#else
#define GNU_ATTRIBUTE(at)
#endif
#if __GNUC__ >= 3
#define GNUC3_ATTRIBUTE(at) __attribute__((at))
#else
#define GNUC3_ATTRIBUTE(at)
#endif
#define STG_UNUSED GNUC3_ATTRIBUTE(__unused__)
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Global type definitions Global type definitions
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
...@@ -106,7 +123,7 @@ typedef StgClosurePtr L_; ...@@ -106,7 +123,7 @@ typedef StgClosurePtr L_;
typedef StgInt64 LI_; typedef StgInt64 LI_;
typedef StgWord64 LW_; typedef StgWord64 LW_;
#define IF_(f) static F_ f(void) #define IF_(f) static F_ GNUC3_ATTRIBUTE(used) f(void)
#define FN_(f) F_ f(void) #define FN_(f) F_ f(void)
#define EF_(f) extern F_ f(void) #define EF_(f) extern F_ f(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment