HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  /// @warning If you set loadGlobal to true, make sure to only register
40  /// callbacks inside HoudiniDSOInit() when it is called the
41  /// second time where dsoinfo.loadGlobal is already set to
42  /// true. Otherwise, Houdini will end up with stale pointers
43  /// to the initial dlclose()'ed instance of your shared DSO.
44  ///
45  bool loadGlobal;
46  };
47 
48  SYS_VISIBILITY_EXPORT void HoudiniDSOVersion(const char **version_string);
49  SYS_VISIBILITY_EXPORT void HoudiniDSOVersionFull(const char **version_string);
50  SYS_VISIBILITY_EXPORT void HoudiniGetTagInfo(const char **version_string);
51 
52  /// If your DSO implements this function, it will be called immediately
53  /// after the DSO is loaded.
54  ///
55  /// dsoinfo.loadGlobal will initially be set to false, but see comment above
56  ///
58 }
59 
60 #ifdef MAKING_DSO
61 
62 extern "C" SYS_VISIBILITY_EXPORT void
63 HoudiniDSOVersion(const char **v) { *v = UT_DSO_VERSION; }
64 extern "C" SYS_VISIBILITY_EXPORT void
65 HoudiniDSOVersionFull(const char **v) { *v = SYS_VERSION_FULL; }
66 
67 #ifdef UT_DSO_TAGINFO
68 extern "C" SYS_VISIBILITY_EXPORT void
69 HoudiniGetTagInfo(const char **v) { *v = UT_DSO_TAGINFO; }
70 #endif
71 
72 #endif // MAKING_DSO
73 
74 #ifdef MAKING_DSO
75 #define UT_DSOVERSION_EXPORT extern "C" SYS_VISIBILITY_EXPORT
76 #else
77 #define UT_DSOVERSION_EXPORT static inline
78 #endif
79 
80 #if defined(__GNUC__)
81 UT_DSOVERSION_EXPORT unsigned
82 HoudiniCompilerVersion() { return (__GNUC__ * 100 + __GNUC_MINOR__); }
83 #elif defined(_MSC_VER)
84 UT_DSOVERSION_EXPORT unsigned
85 HoudiniCompilerVersion() { return (_MSC_VER); }
86 #else
87 #error Unsupported compiler
88 #endif
89 
90 #endif // __UT_DSOVersion__
SYS_VISIBILITY_EXPORT void HoudiniDSOVersion(const char **version_string)
#define SYS_VISIBILITY_EXPORT
bool loadGlobal
Definition: UT_DSOVersion.h:45
const GLdouble * v
Definition: glcorearb.h:837
#define UT_DSOVERSION_EXPORT
Definition: UT_DSOVersion.h:77
SYS_VISIBILITY_EXPORT void HoudiniDSOInit(UT_DSOInfo &dsoinfo)
SYS_VISIBILITY_EXPORT void HoudiniDSOVersionFull(const char **version_string)
SYS_VISIBILITY_EXPORT void HoudiniGetTagInfo(const char **version_string)
#define SYS_VERSION_FULL
Definition: SYS_Version.h:27
#define UT_DSO_VERSION
Definition: UT_DSOVersion.h:23