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 44
55class BadMutex {
66 public:
7+ const static unsigned int version = 0x000100 ;
78 static BadMutex& getInstance ( void );
89 void lock ( void );
910 void unlock ( void );
Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ for path in *libraryPaths
1414
1515assert success, BM
1616
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+
1722return {
1823 lock : ->
1924 BM . lock!
@@ -23,4 +28,6 @@ return {
2328
2429 unlock : ->
2530 BM . unlock!
31+
32+ version : 0x000100
2633}
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ extern "C" {
1313 EXPORT void unlock ( void ) {
1414 BadMutex::getInstance ().unlock ();
1515 }
16+
17+ EXPORT unsigned int version ( void ) {
18+ return BadMutex::version;
19+ }
1620}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ extern "C" {
1414EXPORT void lock ( void );
1515EXPORT bool try_lock ( void );
1616EXPORT void unlock ( void );
17+ EXPORT unsigned int version ( void );
1718
1819#ifdef __cplusplus
1920}
You can’t perform that action at this time.
0 commit comments