Commit 9a9803e8 authored by Simon Marlow's avatar Simon Marlow

Omit visibility pragmas on Windows (fixes warnings/validate failures)

parent b25c93f1
...@@ -51,7 +51,19 @@ extern "C" { ...@@ -51,7 +51,19 @@ extern "C" {
// Symbols that are extern, but private to the RTS, are declared // Symbols that are extern, but private to the RTS, are declared
// with visibility "hidden" to hide them outside the RTS shared // with visibility "hidden" to hide them outside the RTS shared
// library. // library.
#if !defined(mingw32_HOST_OS)
#define RTS_PRIVATE GNUC3_ATTRIBUTE(visibility("hidden")) #define RTS_PRIVATE GNUC3_ATTRIBUTE(visibility("hidden"))
#else
#define RTS_PRIVATE /* disabled: RTS_PRIVATE */
#endif
#if __GNUC__ > 4
#define BEGIN_RTS_PRIVATE #pragma GCC visibility push(hidden)
#define END_RTS_PRIVATE #pragma GCC visibility pop
#else
#define BEGIN_RTS_PRIVATE /* disabled: BEGIN_RTS_PRIVATE */
#define END_RTS_PRIVATE /* disabled: END_RTS_PRIVATE */
#endif
/* Fix for mingw stat problem (done here so it's early enough) */ /* Fix for mingw stat problem (done here so it's early enough) */
#ifdef mingw32_HOST_OS #ifdef mingw32_HOST_OS
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "Task.h" #include "Task.h"
#include "Sparks.h" #include "Sparks.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
struct Capability_ { struct Capability_ {
// State required by the STG virtual machine when running Haskell // State required by the STG virtual machine when running Haskell
...@@ -332,6 +332,6 @@ contextSwitchCapability (Capability *cap) ...@@ -332,6 +332,6 @@ contextSwitchCapability (Capability *cap)
cap->context_switch = 1; cap->context_switch = 1;
} }
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* CAPABILITY_H */ #endif /* CAPABILITY_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef FRONTPANEL_H #ifndef FRONTPANEL_H
#define FRONTPANEL_H #define FRONTPANEL_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
#ifdef RTS_GTK_FRONTPANEL #ifdef RTS_GTK_FRONTPANEL
...@@ -33,7 +33,7 @@ extern gboolean continue_now, stop_now, quit; ...@@ -33,7 +33,7 @@ extern gboolean continue_now, stop_now, quit;
#endif /* RTS_GTK_FRONTPANEL */ #endif /* RTS_GTK_FRONTPANEL */
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* FRONTPANEL_H */ #endif /* FRONTPANEL_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef GETTIME_H #ifndef GETTIME_H
#define GETTIME_H #define GETTIME_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
// We'll use a fixed resolution of usec for now. The machine // We'll use a fixed resolution of usec for now. The machine
// dependent implementation may have a different resolution, but we'll // dependent implementation may have a different resolution, but we'll
...@@ -25,6 +25,6 @@ void getProcessTimes (Ticks *user, Ticks *elapsed); ...@@ -25,6 +25,6 @@ void getProcessTimes (Ticks *user, Ticks *elapsed);
// Not strictly timing, but related // Not strictly timing, but related
nat getPageFaults (void); nat getPageFaults (void);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* GETTIME_H */ #endif /* GETTIME_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef HASH_H #ifndef HASH_H
#define HASH_H #define HASH_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
typedef struct hashtable HashTable; /* abstract */ typedef struct hashtable HashTable; /* abstract */
...@@ -47,7 +47,7 @@ void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) ); ...@@ -47,7 +47,7 @@ void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) );
void exitHashTable ( void ); void exitHashTable ( void );
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* HASH_H */ #endif /* HASH_H */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef PAPI_H #ifndef PAPI_H
#define PAPI_H #define PAPI_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* Check the error value of a PAPI call, reporting an error, if needed */ /* Check the error value of a PAPI call, reporting an error, if needed */
extern int papi_error; extern int papi_error;
...@@ -31,6 +31,6 @@ void papi_stop_gc1_count(void); ...@@ -31,6 +31,6 @@ void papi_stop_gc1_count(void);
void papi_thread_start_gc1_count(int event_set); void papi_thread_start_gc1_count(int event_set);
void papi_thread_stop_gc1_count(int event_set); void papi_thread_stop_gc1_count(int event_set);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PAPI_H */ #endif /* PAPI_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef PRINTER_H #ifndef PRINTER_H
#define PRINTER_H #define PRINTER_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
extern void printPtr ( StgPtr p ); extern void printPtr ( StgPtr p );
extern void printObj ( StgClosure *obj ); extern void printObj ( StgClosure *obj );
...@@ -34,7 +34,7 @@ extern const char *lookupGHCName( void *addr ); ...@@ -34,7 +34,7 @@ extern const char *lookupGHCName( void *addr );
extern char *what_next_strs[]; extern char *what_next_strs[];
#endif #endif
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PRINTER_H */ #endif /* PRINTER_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef PROFHEAP_H #ifndef PROFHEAP_H
#define PROFHEAP_H #define PROFHEAP_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void heapCensus (void); void heapCensus (void);
nat initHeapProfiling (void); nat initHeapProfiling (void);
...@@ -17,6 +17,6 @@ void endHeapProfiling (void); ...@@ -17,6 +17,6 @@ void endHeapProfiling (void);
void LDV_recordDead (StgClosure *c, nat size); void LDV_recordDead (StgClosure *c, nat size);
rtsBool strMatchesSelector (char* str, char* sel); rtsBool strMatchesSelector (char* str, char* sel);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PROFHEAP_H */ #endif /* PROFHEAP_H */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <stdio.h> #include <stdio.h>
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void initProfiling1 (void); void initProfiling1 (void);
void freeProfiling1 (void); void freeProfiling1 (void);
...@@ -37,6 +37,6 @@ void debugCCS( CostCentreStack *ccs ); ...@@ -37,6 +37,6 @@ void debugCCS( CostCentreStack *ccs );
#endif #endif
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PROFILING_H */ #endif /* PROFILING_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef PROFTIMER_H #ifndef PROFTIMER_H
#define PROFTIMER_H #define PROFTIMER_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void initProfTimer ( void ); void initProfTimer ( void );
void handleProfTick ( void ); void handleProfTick ( void );
...@@ -24,6 +24,6 @@ void startHeapProfTimer ( void ); ...@@ -24,6 +24,6 @@ void startHeapProfTimer ( void );
extern rtsBool performHeapProfile; extern rtsBool performHeapProfile;
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PROFTIMER_H */ #endif /* PROFTIMER_H */
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
#ifndef RAISEASYNC_H #ifndef RAISEASYNC_H
#define RAISEASYNC_H #define RAISEASYNC_H
#pragma GCC visibility push(hidden)
#define THROWTO_SUCCESS 0 #define THROWTO_SUCCESS 0
#define THROWTO_BLOCKED 1 #define THROWTO_BLOCKED 1
#ifndef CMINUSMINUS #ifndef CMINUSMINUS
BEGIN_RTS_PRIVATE
void throwToSingleThreaded (Capability *cap, void throwToSingleThreaded (Capability *cap,
StgTSO *tso, StgTSO *tso,
StgClosure *exception); StgClosure *exception);
...@@ -66,9 +67,9 @@ interruptible(StgTSO *t) ...@@ -66,9 +67,9 @@ interruptible(StgTSO *t)
} }
} }
#endif /* CMINUSMINUS */ END_RTS_PRIVATE
#pragma GCC visibility pop #endif /* CMINUSMINUS */
#endif /* RAISEASYNC_H */ #endif /* RAISEASYNC_H */
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "RetainerSet.h" #include "RetainerSet.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void initRetainerProfiling ( void ); void initRetainerProfiling ( void );
void endRetainerProfiling ( void ); void endRetainerProfiling ( void );
...@@ -43,7 +43,7 @@ retainerSetOf( StgClosure *c ) ...@@ -43,7 +43,7 @@ retainerSetOf( StgClosure *c )
extern lnat retainerStackBlocks ( void ); extern lnat retainerStackBlocks ( void );
#endif #endif
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PROFILING */ #endif /* PROFILING */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#ifdef PROFILING #ifdef PROFILING
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* /*
Type 'retainer' defines the retainer identity. Type 'retainer' defines the retainer identity.
...@@ -199,7 +199,7 @@ void outputAllRetainerSet(FILE *); ...@@ -199,7 +199,7 @@ void outputAllRetainerSet(FILE *);
// the best place to define it. // the best place to define it.
void printRetainer(FILE *, retainer); void printRetainer(FILE *, retainer);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* PROFILING */ #endif /* PROFILING */
#endif /* RETAINERSET_H */ #endif /* RETAINERSET_H */
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#if RTS_USER_SIGNALS #if RTS_USER_SIGNALS
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* /*
* Function: initUserSignals() * Function: initUserSignals()
...@@ -60,7 +60,7 @@ void awaitUserSignals(void); ...@@ -60,7 +60,7 @@ void awaitUserSignals(void);
*/ */
void markSignalHandlers (evac_fn evac, void *user); void markSignalHandlers (evac_fn evac, void *user);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* RTS_USER_SIGNALS */ #endif /* RTS_USER_SIGNALS */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef RTSUTILS_H #ifndef RTSUTILS_H
#define RTSUTILS_H #define RTSUTILS_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* (Checked) dynamic allocation * (Checked) dynamic allocation
...@@ -48,6 +48,6 @@ int genericRaise(int sig); ...@@ -48,6 +48,6 @@ int genericRaise(int sig);
int rts_isProfiled(void); int rts_isProfiled(void);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* RTSUTILS_H */ #endif /* RTSUTILS_H */
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define STM_UNIPROC #define STM_UNIPROC
#endif #endif
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -232,7 +232,7 @@ void stmWriteTVar(Capability *cap, ...@@ -232,7 +232,7 @@ void stmWriteTVar(Capability *cap,
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* STM_H */ #endif /* STM_H */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#ifdef DEBUG #ifdef DEBUG
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
# if defined(PAR) # if defined(PAR)
# define PVM_PE_MASK 0xfffc0000 # define PVM_PE_MASK 0xfffc0000
...@@ -36,7 +36,7 @@ void checkMutableLists ( rtsBool checkTSOs ); ...@@ -36,7 +36,7 @@ void checkMutableLists ( rtsBool checkTSOs );
void checkBQ (StgTSO *bqe, StgClosure *closure); void checkBQ (StgTSO *bqe, StgClosure *closure);
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* DEBUG */ #endif /* DEBUG */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "Capability.h" #include "Capability.h"
#include "Trace.h" #include "Trace.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* initScheduler(), exitScheduler() /* initScheduler(), exitScheduler()
* Called from STG : no * Called from STG : no
...@@ -241,7 +241,7 @@ emptyThreadQueues(Capability *cap) ...@@ -241,7 +241,7 @@ emptyThreadQueues(Capability *cap)
#endif /* !IN_STG_CODE */ #endif /* !IN_STG_CODE */
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* SCHEDULE_H */ #endif /* SCHEDULE_H */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "WSDeque.h" #include "WSDeque.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* typedef for SparkPool in RtsTypes.h */ /* typedef for SparkPool in RtsTypes.h */
...@@ -65,6 +65,6 @@ INLINE_HEADER void discardSparks (SparkPool *pool) ...@@ -65,6 +65,6 @@ INLINE_HEADER void discardSparks (SparkPool *pool)
#endif // THREADED_RTS #endif // THREADED_RTS
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* SPARKS_H */ #endif /* SPARKS_H */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "sm/GC.h" // for evac_fn below #include "sm/GC.h" // for evac_fn below
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void freeStablePtr ( StgStablePtr sp ); void freeStablePtr ( StgStablePtr sp );
...@@ -33,6 +33,6 @@ void updateStablePtrTable ( rtsBool full ); ...@@ -33,6 +33,6 @@ void updateStablePtrTable ( rtsBool full );
void stablePtrPreGC ( void ); void stablePtrPreGC ( void );
void stablePtrPostGC ( void ); void stablePtrPostGC ( void );
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* STABLE_H */ #endif /* STABLE_H */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "GetTime.h" #include "GetTime.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
void stat_startInit(void); void stat_startInit(void);
void stat_endInit(void); void stat_endInit(void);
...@@ -61,6 +61,6 @@ Ticks stat_getElapsedTime(void); ...@@ -61,6 +61,6 @@ Ticks stat_getElapsedTime(void);
void statsPrintf( char *s, ... ) void statsPrintf( char *s, ... )
GNUC3_ATTRIBUTE(format (printf, 1, 2)); GNUC3_ATTRIBUTE(format (printf, 1, 2));
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* STATS_H */ #endif /* STATS_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef STGPRIMFLOAT_H #ifndef STGPRIMFLOAT_H
#define STGPRIMFLOAT_H #define STGPRIMFLOAT_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* grimy low-level support functions defined in StgPrimFloat.c */ /* grimy low-level support functions defined in StgPrimFloat.c */
void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl); void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl);
...@@ -21,6 +21,6 @@ StgFloat __word_encodeFloat (W_ j, I_ e); ...@@ -21,6 +21,6 @@ StgFloat __word_encodeFloat (W_ j, I_ e);
// __int_encodeDouble and __int_encodeFloat are public, declared in // __int_encodeDouble and __int_encodeFloat are public, declared in
// includes/rts/PrimFloat.h. // includes/rts/PrimFloat.h.
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* STGPRIMFLOAT_H */ #endif /* STGPRIMFLOAT_H */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "GetTime.h" #include "GetTime.h"
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
/* /*
Definition of a Task Definition of a Task
...@@ -261,6 +261,6 @@ taskEnter (Task *task) ...@@ -261,6 +261,6 @@ taskEnter (Task *task)
setMyTask(task); setMyTask(task);
} }
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* TASK_H */ #endif /* TASK_H */
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#ifndef THREADLABELS_H #ifndef THREADLABELS_H
#define THREADLABELS_H #define THREADLABELS_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
#if defined(DEBUG) #if defined(DEBUG)
void initThreadLabelTable (void); void initThreadLabelTable (void);
...@@ -21,6 +21,6 @@ void removeThreadLabel (StgWord key); ...@@ -21,6 +21,6 @@ void removeThreadLabel (StgWord key);
void labelThread (StgPtr tso, char *label); void labelThread (StgPtr tso, char *label);
#endif #endif
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* THREADLABELS_H */ #endif /* THREADLABELS_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef THREADS_H #ifndef THREADS_H
#define THREADS_H #define THREADS_H
#pragma GCC visibility push(hidden) BEGIN_RTS_PRIVATE
StgTSO * unblockOne (Capability *cap, StgTSO *tso); StgTSO * unblockOne (Capability *cap, StgTSO *tso);
StgTSO * unblockOne_ (Capability *cap, StgTSO *tso, rtsBool allow_migrate); StgTSO * unblockOne_ (Capability *cap, StgTSO *tso, rtsBool allow_migrate);
...@@ -29,6 +29,6 @@ void printAllThreads (void); ...@@ -29,6 +29,6 @@ void printAllThreads (void);
void printThreadQueue (StgTSO *t); void printThreadQueue (StgTSO *t);
#endif #endif
#pragma GCC visibility pop END_RTS_PRIVATE
#endif /* THREADS_H */ #endif /* THREADS_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef TICKER_H #ifndef TICKER_H
#define TICKER_H #define TICKER_H