1 /**
2    To avoid cyclic dependencies with module constructors
3  */
4 module xlld.static_;
5 
6 ///
7 shared static this() {
8     import xlld.conv.from: gToEnumMutex;
9     import xlld.conv.to: gFromEnumMutex;
10     import core.sync.mutex: Mutex;
11     gToEnumMutex = new shared Mutex;
12     gFromEnumMutex = new shared Mutex;
13 }
14 
15 
16 version(testLibraryExcelD):
17 
18 ///
19 shared static this() {
20     import xlld.sdk.xlcall: XLOPER12;
21     import xlld.test.util: gAsyncReturns, AA;
22     gAsyncReturns = AA!(XLOPER12, XLOPER12).create;
23 }
24 
25 ///
26 static this() {
27     import xlld.test.util: excel12UnitTest;
28     import xlld.sdk.xlcallcpp: SetExcel12EntryPt;
29     // this effectively "implements" the Excel12v function
30     // so that the code can be unit tested without needing to link
31     // with the Excel SDK
32     SetExcel12EntryPt(&excel12UnitTest);
33 }
34 
35 ///
36 static ~this() {
37     import xlld.test.util: gAllocated, gFreed, gNumXlAllocated, gNumXlFree;
38     import unit_threaded.should: shouldBeSameSetAs;
39     gAllocated[0 .. gNumXlAllocated].shouldBeSameSetAs(gFreed[0 .. gNumXlFree]);
40 }