File tree Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class BadMutex {
6
6
public:
7
+ const static unsigned int version = 0x000100 ;
7
8
static BadMutex& getInstance ( void );
8
9
void lock ( void );
9
10
void unlock ( void );
Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ for path in *libraryPaths
14
14
15
15
assert success, BM
16
16
17
+ BMVersion = 0x000100
18
+ libVer = BM . version!
19
+ if libVer < BMVersion or math.floor ( libVer/ 65536 % 256 ) > math.floor ( BMVersion / 65536 % 256 )
20
+ error " Library version mismatch. Wanted #{BMVersion}, got #{libVer}."
21
+
17
22
return {
18
23
lock : ->
19
24
BM . lock!
@@ -23,4 +28,6 @@ return {
23
28
24
29
unlock : ->
25
30
BM . unlock!
31
+
32
+ version : 0x000100
26
33
}
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ extern "C" {
13
13
EXPORT void unlock ( void ) {
14
14
BadMutex::getInstance ().unlock ();
15
15
}
16
+
17
+ EXPORT unsigned int version ( void ) {
18
+ return BadMutex::version;
19
+ }
16
20
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ extern "C" {
14
14
EXPORT void lock ( void );
15
15
EXPORT bool try_lock ( void );
16
16
EXPORT void unlock ( void );
17
+ EXPORT unsigned int version ( void );
17
18
18
19
#ifdef __cplusplus
19
20
}
You can’t perform that action at this time.
0 commit comments