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 HoudiniGetTagInfo(const char **version_string);
50 
51  /// If your DSO implements this function, it will be called immediately
52  /// after the DSO is loaded.
53  ///
54  /// dsoinfo.loadGlobal will initially be set to false, but see comment above
55  ///
57 }
58 
59 #ifdef MAKING_DSO
60 
61 extern "C" SYS_VISIBILITY_EXPORT void
62 HoudiniDSOVersion(const char **v) { *v = UT_DSO_VERSION; }
63 #ifdef UT_DSO_TAGINFO
64 extern "C" SYS_VISIBILITY_EXPORT void
65 HoudiniGetTagInfo(const char **v) { *v = UT_DSO_TAGINFO; }
66 #endif
67 
68 #endif // MAKING_DSO
69 
70 #ifdef MAKING_DSO
71 #define UT_DSOVERSION_EXPORT extern "C" SYS_VISIBILITY_EXPORT
72 #else
73 #define UT_DSOVERSION_EXPORT static inline
74 #endif
75 
76 #if defined(__GNUC__)
77 UT_DSOVERSION_EXPORT unsigned
78 HoudiniCompilerVersion() { return (__GNUC__ * 100 + __GNUC_MINOR__); }
79 #elif defined(_MSC_VER)
80 UT_DSOVERSION_EXPORT unsigned
81 HoudiniCompilerVersion() { return (_MSC_VER); }
82 #else
83 #error Unsupported compiler
84 #endif
85 
86 #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:73
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