1 /**
2 * Begin svn Header
3 * $Rev: 27 $:	Revision of last commit
4 * $Author: josephodada@gmail.com $:	Author of last commit
5 * $Date: 2013-04-25 10:07:15 +0100 (Thu, 25 Apr 2013) $:	Date of last commit
6 * $HeadURL: https://numl.googlecode.com/svn/trunk/libnuml/src/common/extern.h $
7 * $Id: extern.h 27 2013-04-25 09:07:15Z josephodada@gmail.com $
8 * End svn Header
9 * ***************************************************************************
10 * This file is part of libNUML.  Please visit http://code.google.com/p/numl/for more
11 * information about NUML, and the latest version of libNUML.
12 * Copyright (c) 2013 The University of Manchester.
13 *
14 * This library is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU Lesser General Public License as published
16 * by the Free Software Foundation.  A copy of the license agreement is
17 * provided in the file named "LICENSE.txt" included with this software
18 * distribution and also available online as http://www.gnu.org/licenses/lgpl.html
19 *
20 * The original code was initially developed by:
21 *
22 * 	SBML Team
23 * 	Control and Dynamical Systems, MC 107-81
24 * 	California Institute of Technology
25 * 	Pasadena, CA, 91125, USA
26 *
27 *  	http://www.sbml.org
28 * 	mailto:sbml-team@caltech.edu
29 *
30 * Adapted for NUML by:
31 *
32 * 	NUML Team
33 * 	Computational Systems Biology Group
34 * 	School of Computer Science
35 * 	The University of Manchester
36 * 	Manchester, M1 7DN UK
37 * 	mailto:josephodada@gmail.com
38 *
39 *   Contributor(s):
40 *   Joseph O. Dada, The University of Manchester - initial LIBNUML API and implementation
41 * ***************************************************************************
42 **/
43 
44 
45 #ifndef LIBNUML_EXTERN_H
46 #define LIBNUML_EXTERN_H
47 
48 #include <numl/common/libnuml-namespace.h>
49 
50 #if ( defined WIN32 && ! defined CYGWIN )
51 
52 #if ( ! defined LIBNUML_STATIC )
53 /**
54  * The following ifdef block is the standard way of creating macros which
55  * make exporting from a DLL simpler. All files within this DLL are
56  * compiled with the LIBNUML_EXPORTS symbol defined on the command line.
57  * This symbol should not be defined on any project that uses this
58  * DLL. This way any other project whose source files include this file see
59  * LIBNUML_EXTERN functions as being imported from a DLL, wheras this DLL
60  * sees symbols defined with this macro as being exported.
61  *
62  * (From Andrew Finney's sbwdefs.h, with "SBW" replaced by "LIBNUML" :)
63  */
64 #if LIBNUML_EXPORTS
65 #  define LIBNUML_EXTERN __declspec(dllexport)
66 #else
67 #  define LIBNUML_EXTERN __declspec(dllimport)
68 #endif
69 
70 #else
71 #  define LIBNUML_EXTERN
72 #endif  /* LIBNUML_STATIC */
73 
74 /**
75  * Disable MSVC++ warning C4800: 'const int' : forcing value to bool 'true'
76  * or 'false' (performance warning).
77  */
78 #pragma warning(disable: 4800)
79 
80 /**
81  * Disable MSVC++ warning C4291: no matching operator delete found.
82  */
83 #pragma warning(disable: 4291)
84 
85 /**
86  * Disable MSVC++ warning C4251: class 'type' needs to have dll-interface
87  * to be used by clients of class 'type2'.
88  *
89  * For an explanation of why this is safe, see:
90  *   - http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
91  */
92 #pragma warning(disable: 4251)
93 
94 #else
95 
96 /**
97  * LIBNUML_EXTERN is used under Windows to simplify exporting functions
98  * from a DLL.  When compiling under Windows, all files within this DLL are
99  * compiled with the LIBNUML_EXPORTS symbol defined on the command line.
100  * This in turn causes extern.h to define a different version of
101  * LIBNUML_EXTERN that is appropriate for exporting functions to client
102  * code that uses the DLL.
103  */
104 #define LIBNUML_EXTERN
105 
106 #endif  /* WIN32 */
107 
108 
109 #if !defined(BEGIN_C_DECLS) && !defined(END_C_DECLS)
110 
111 #if __cplusplus
112 #  define BEGIN_C_DECLS extern "C" {
113 #  define END_C_DECLS   }
114 #else
115 #  define BEGIN_C_DECLS
116 #  define END_C_DECLS
117 #endif
118 
119 #endif
120 
121 
122 #endif  /** LIBNUML_EXTERN_H **/
123