Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / export.h
1 /* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 */
8
9 #ifndef _MLTON_EXPORT_H_
10 #define _MLTON_EXPORT_H_
11
12 /* ------------------------------------------------- */
13 /* Symbols */
14 /* ------------------------------------------------- */
15
16 /* An external symbol is something not defined by the module
17 * (executable or library) being built. Rather, it is provided
18 * from a library dependency (dll, dylib, or shared object).
19 *
20 * A public symbol is defined in this module as being available
21 * to users outside of this module. If building a library, this
22 * means the symbol will be part of the public interface.
23 *
24 * A private symbol is defined within this module, but will not
25 * be made available outside of it. This is typically used for
26 * internal implementation details that should not be accessible.
27 */
28
29 #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
30 #define EXTERNAL __declspec(dllimport)
31 #define PUBLIC __declspec(dllexport)
32 #define PRIVATE
33 #else
34 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
35 #define EXTERNAL __attribute__((visibility("default")))
36 #define PUBLIC __attribute__((visibility("default")))
37 #define PRIVATE __attribute__((visibility("hidden")))
38 #else
39 #define EXTERNAL
40 #define PUBLIC
41 #define PRIVATE
42 #endif
43 #endif
44
45 #endif /* _MLTON_EXPORT_H_ */