HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_DSOVersion.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_DSOVersion.h ( UT Library, C++)
7  *
8  * COMMENTS: This header file defines the version information
9  * for every DSO.
10  *
11  * It also specifies the initialization function prototype
12  * HoudiniDSOInit, and the UT_DSOInfo struct that specifies
13  * how a DSO should be initialized.
14  */
15 
16 #ifndef __UT_DSOVersion__
17 #define __UT_DSOVersion__
18 
19 #include <SYS/SYS_Types.h>
20 #include <SYS/SYS_Version.h>
21 #include <SYS/SYS_Visibility.h>
22 
23 #define UT_DSO_VERSION SYS_VERSION_RELEASE
24 
25 extern "C" {
26  class UT_DSOInfo
27  {
28  public:
29  /*
30  * Linux only:
31  * Set to true if this DSO should be loaded with RTLD_GLOBAL.
32  * Note that this will mean that your DSO is dlclose()'ed, and then
33  * re-dlopen()'ed.
34  *
35  * If set to true, then HoudiniDSOInit will be called again after the
36  * DSO is re-openend. The UT_DSOInfo struct will have its loadGlobal
37  * member set to true.
38  */
39  bool loadGlobal;
40  };
41 
42  SYS_VISIBILITY_EXPORT void HoudiniDSOVersion(const char **version_string);
43  SYS_VISIBILITY_EXPORT void HoudiniGetTagInfo(const char **version_string);
44 
45  /*
46  * If your DSO implements this function, it will be called immediately
47  * after the DSO is loaded.
48  *
49  * dsoinfo.loadGlobal will initially be set to false, but see comment above
50  *
51  */
53 }
54 
55 #ifdef MAKING_DSO
56 
57 extern "C" SYS_VISIBILITY_EXPORT void
58 HoudiniDSOVersion(const char **v) { *v = UT_DSO_VERSION; }
59 #ifdef UT_DSO_TAGINFO
60 extern "C" SYS_VISIBILITY_EXPORT void
61 HoudiniGetTagInfo(const char **v) { *v = UT_DSO_TAGINFO; }
62 #endif
63 
64 #endif // MAKING_DSO
65 
66 #ifdef MAKING_DSO
67 #define UT_DSOVERSION_EXPORT extern "C" SYS_VISIBILITY_EXPORT
68 #else
69 #define UT_DSOVERSION_EXPORT static inline
70 #endif
71 
72 #if defined(__GNUC__)
73 UT_DSOVERSION_EXPORT unsigned
74 HoudiniCompilerVersion() { return (__GNUC__ * 100 + __GNUC_MINOR__); }
75 #elif defined(_MSC_VER)
76 UT_DSOVERSION_EXPORT unsigned
77 HoudiniCompilerVersion() { return (_MSC_VER); }
78 #else
79 #error Unsupported compiler
80 #endif
81 
82 #endif // __UT_DSOVersion__
SYS_VISIBILITY_EXPORT void HoudiniDSOVersion(const char **version_string)
#define SYS_VISIBILITY_EXPORT
bool loadGlobal
Definition: UT_DSOVersion.h:39
const GLdouble * v
Definition: glcorearb.h:836
#define UT_DSOVERSION_EXPORT
Definition: UT_DSOVersion.h:69
SYS_VISIBILITY_EXPORT void HoudiniDSOInit(UT_DSOInfo &dsoinfo)
SYS_VISIBILITY_EXPORT void HoudiniGetTagInfo(const char **version_string)
#define UT_DSO_VERSION
Definition: UT_DSOVersion.h:23