Commit 539d72f6 authored by sof's avatar sof

[project @ 1999-05-04 08:52:22 by sof]

Moved DLL-related macros out of Stg.h and into separate .h file
parent 5dbade44
/* -----------------------------------------------------------------------------
* $Id: Prelude.h,v 1.7 1999/03/17 13:19:19 simonm Exp $
* $Id: Prelude.h,v 1.8 1999/05/04 08:52:23 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -94,6 +94,6 @@ extern const StgInfoTable StablePtr_static_info;
#endif
#endif
#endif /* COMPILING_RTS */
#endif /* PRELUDE_H */
/* -----------------------------------------------------------------------------
* $Id: Stg.h,v 1.9 1999/03/15 16:30:25 simonm Exp $
* $Id: Stg.h,v 1.10 1999/05/04 08:52:22 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -22,43 +22,14 @@
#include "options.h"
#endif
/* Some macros to handle DLLing (Win32 only at the moment). */
#include "StgDLL.h"
/* ToDo: Set this flag properly: COMPILER and INTERPRETER should not be mutually exclusive. */
#ifndef INTERPRETER
#define COMPILER 1
#endif
/* This is a feature test - doesn't belong here. FixMe. */
#ifdef __MINGW32__
#define HAVE_WIN32_DLL_SUPPORT
#endif
#ifdef HAVE_WIN32_DLL_SUPPORT
# if __GNUC__ && !defined(__declspec)
# define DLLIMPORT
# else
# define DLLIMPORT __declspec(dllimport)
# define DLLIMPORT_DATA(x) _imp__##x
# endif
#else
# define DLLIMPORT
#endif
#ifdef COMPILING_RTS
#define DLL_IMPORT DLLIMPORT
#define DLL_IMPORT_RTS
#define DLL_IMPORT_DATA
#define DLL_IMPORT_DATA_VAR(x) x
#else
#define DLL_IMPORT
#define DLL_IMPORT_RTS DLLIMPORT
#define DLL_IMPORT_DATA DLLIMPORT
# ifdef HAVE_WIN32_DLL_SUPPORT
# define DLL_IMPORT_DATA_VAR(x) _imp__##x
# else
# define DLL_IMPORT_DATA_VAR(x) x
# endif
#endif
/* bit macros
*/
#define BITS_PER_BYTE 8
......@@ -160,7 +131,8 @@ extern char **environ;
/* Creating and destroying an adjustor thunk.
I cannot make myself create a separate .h file
for these two (sof.)
for these two (sof.)
*/
extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
extern void freeHaskellFunctionPtr(void* ptr);
......
#ifndef __STGDLL_H__
#define __STGDLL_H__ 1
#if defined(HAVE_WIN32_DLL_SUPPORT) && !defined(DONT_WANT_WIN32_DLL_SUPPORT)
#define ENABLE_WIN32_DLL_SUPPORT
#endif
#ifdef ENABLE_WIN32_DLL_SUPPORT
# if __GNUC__ && !defined(__declspec)
# define DLLIMPORT
# else
# define DLLIMPORT __declspec(dllimport)
# define DLLIMPORT_DATA(x) _imp__##x
# endif
#else
# define DLLIMPORT
#endif
/* The view of the ghc/includes/ header files differ ever so
slightly depending on whether the RTS is being compiled
or not - so we're forced to distinguish between two.
[oh, you want details :) : Data symbols defined by the RTS
have to be accessed through an extra level of indirection
when compiling generated .hc code compared to when the RTS
sources are being processed. This is only the case when
using Win32 DLLs. ]
*/
#ifdef COMPILING_RTS
#define DLL_IMPORT DLLIMPORT
#define DLL_IMPORT_RTS
#define DLL_IMPORT_DATA
#define DLL_IMPORT_DATA_VAR(x) x
#else
#define DLL_IMPORT
#define DLL_IMPORT_RTS DLLIMPORT
#define DLL_IMPORT_DATA DLLIMPORT
# ifdef ENABLE_WIN32_DLL_SUPPORT
# define DLL_IMPORT_DATA_VAR(x) _imp__##x
# else
# define DLL_IMPORT_DATA_VAR(x) x
# endif
#endif
#endif /* __STGDLL_H__ */
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