Coin_C_defines.h
Go to the documentation of this file.
1 /* $Id: Coin_C_defines.h 1215 2009-11-05 11:03:04Z forrest $ */
2 /* Copyright (C) 2002, 2003 International Business Machines
3  Corporation and others. All Rights Reserved.*/
4 #ifndef CoinCDefine_H
5 #define CoinCDefine_H
6 
11 /* Plus infinity */
12 #ifndef COIN_DBL_MAX
13 #define COIN_DBL_MAX DBL_MAX
14 #endif
15 #if defined (CLP_EXTERN_C)
16 #define COIN_EXTERN_C
17 #define COIN_NO_SBB
18 #define COIN_NO_CBC
19 #endif
20 #if defined (SBB_EXTERN_C)
21 #define COIN_EXTERN_C
22 #define COIN_NO_CLP
23 #endif
24 #if defined (CBC_EXTERN_C)
25 #define COIN_EXTERN_C
26 #define COIN_NO_CLP
27 #endif
28 /* We need to allow for Microsoft */
29 #ifndef COINLIBAPI
30 
31 #if defined(CBCCINTERFACEDLL_EXPORTS) || defined(CLPMSDLL)
32 #if defined (COIN_EXTERN_C)
33 # define COINLIBAPI __declspec(dllexport)
34 #else
35 # define COINLIBAPI __declspec(dllexport)
36 #endif
37 # define COINLINKAGE __stdcall
38 # define COINLINKAGE_CB __cdecl
39 #else
40 #if defined (COIN_EXTERN_C)
41 # define COINLIBAPI extern "C"
42 #else
43 # define COINLIBAPI
44 #endif
45 # define COINLINKAGE
46 # define COINLINKAGE_CB
47 #endif
48 
49 #endif
50 
51 #if defined (CLP_EXTERN_C)
52 /* Real typedef for structure */
53 class CMessageHandler;
54 typedef struct {
55  ClpSimplex * model_;
56  CMessageHandler * handler_;
57 } Clp_Simplex;
58 #else
59 typedef void Clp_Simplex;
60 #endif
61 
62 #ifndef COIN_NO_CLP
63 
65 typedef void (COINLINKAGE_CB *clp_callback) (Clp_Simplex * model,int msgno, int ndouble,
66  const double * dvec, int nint, const int * ivec,
67  int nchar, char ** cvec);
68 #endif
69 
70 #if defined (SBB_EXTERN_C)
71 /* Real typedef for structure */
72 class Sbb_MessageHandler;
73 typedef struct {
74  OsiClpSolverInterface * solver_;
75  SbbModel * model_;
76  Sbb_MessageHandler * handler_;
77  char * information_;
78 } Sbb_Model;
79 #else
80 typedef void Sbb_Model;
81 #endif
82 #if defined (CBC_EXTERN_C)
83 /* Real typedef for structure */
84 class Cbc_MessageHandler;
85 typedef struct {
86  OsiClpSolverInterface * solver_;
87  CbcModel * model_;
88  Cbc_MessageHandler * handler_;
89  char * information_;
90 } Cbc_Model;
91 #else
92 typedef void Cbc_Model;
93 #endif
94 #ifndef COIN_NO_SBB
95 
97 typedef void (COINLINKAGE_CB *sbb_callback) (Sbb_Model * model,int msgno, int ndouble,
98  const double * dvec, int nint, const int * ivec,
99  int nchar, char ** cvec);
100 typedef void (COINLINKAGE_CB *cbc_callback) (Cbc_Model * model,int msgno, int ndouble,
101  const double * dvec, int nint, const int * ivec,
102  int nchar, char ** cvec);
103 #endif
104 #if COIN_BIG_INDEX==0
105 typedef int CoinBigIndex;
106 #elif COIN_BIG_INDEX==1
107 typedef long CoinBigIndex;
108 #else
109 typedef long long CoinBigIndex;
110 #endif
111 /* just in case used somewhere */
112 #undef COIN_NO_CLP
113 #undef COIN_NO_SBB
114 #undef COIN_NO_CBC
115 #endif