Skip to content

Commit 082186c

Browse files
committed
* update SDK conversion for VS2013 and Windws SDK 8.1
* change some default colors when using dark theme in VS 2012+ (restart required) * Windows SDK 8.0/8.1 detection * fix bad "\n" in default x64 library search path * x64 executable and library search path not correctly saved for next VS start * improve project automation to mute NuGet (still empty project pretended) * changes to build with dmd 2.066alpha
1 parent b1d8eb5 commit 082186c

23 files changed

+828
-149
lines changed

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,10 @@ unreleased Version 0.3.38
607607
* fixed project and completion icons being converted to 16 color bitmaps
608608
* completion box now displays appropriate icons and tooltip with dparser
609609
* tool tips now expand some Ddoc macros for better readability
610+
611+
* update SDK conversion for VS2013 and Windws SDK 8.1
612+
* change some default colors when using dark theme in VS 2012+ (restart required)
613+
* Windows SDK 8.0/8.1 detection
614+
* fix bad "\n" in default x64 library search path
615+
* x64 executable and library search path not correctly saved for next VS start
616+
* improve project automation to mute NuGet (still empty project pretended)

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $(VSI2D_EXE) : $(VSI2D_SRC)
108108
$(DMD2_) -d -map $@.map -of$@ -version=vsi $(VSI2D_SRC)
109109

110110
sdk\vsi_sources: $(VSI2D_EXE)
111-
$(VSI2D_EXE) -vsi="$(VSISDK)" -win="$(WINSDK)\Include" -dte="$(DTE_IDL_PATH)" -sdk=sdk
111+
$(VSI2D_EXE) --vsi="$(VSISDK)" --win="$(WINSDK)\Include" --dte="$(DTE_IDL_PATH)" --sdk=sdk
112112

113113
# $(VSI_LIB) : sdk\vsi_sources
114114
vsi_lib:
@@ -133,14 +133,24 @@ cpp2d_exe:
133133
idl2d_exe: $(VSI2D_EXE)
134134
copy $(VSI2D_EXE) ..\downloads\idl2d.exe
135135

136+
prerequisites:
137+
devenv /Project "build" /Build "Release|Win32" visuald_vs10.sln
138+
139+
visuald_vs:
140+
devenv /Project "visuald" /Build "Release|Win32" visuald_vs10.sln
141+
142+
vdserver:
143+
devenv /Project "vdserver" /Build "Release|Win32" visuald_vs10.sln
144+
136145
dparser:
137146
cd vdc\abothe && $(MSBUILD) vdserver.sln /p:Configuration=Release /t:Rebuild
138147

139148
mago:
140-
cd ..\..\mago && devenv /Build "Release|Win32" magodbg.sln
149+
cd ..\..\mago && devenv /Build "Release|Win32" /Project "MagoNatDE" magodbg_2010.sln
141150

142151
cv2pdb:
143-
cd ..\..\cv2pdb\trunk && devenv /Build "Release|Win32" src\cv2pdb.sln
152+
cd ..\..\cv2pdb\trunk && devenv /Project "cv2pdb" /Build "Release|Win32" src\cv2pdb_vs12.sln
153+
cd ..\..\cv2pdb\trunk && devenv /Project "dviewhelper" /Build "Release|Win32" src\cv2pdb_vs12.sln
144154

145155
##################################
146156
# create installer
@@ -149,6 +159,9 @@ install: all cpp2d_exe idl2d_exe
149159
cd nsis && "$(NSIS)\makensis" /V1 visuald.nsi
150160
"$(ZIP)" -j ..\downloads\visuald_pdb.zip bin\release\visuald.pdb bin\release\vdserver.pdb
151161

162+
#prerequisites
163+
install_vs: visuald_vs vdserver cv2pdb dparser mago install_only
164+
152165
install_only:
153166
cd nsis && "$(NSIS)\makensis" /V1 visuald.nsi
154167

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 3
33
#define VERSION_REVISION 38
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 2
5+
#define VERSION_BUILD 3

build/sdk.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if not exist %DTE_IDL_PATH%\nul md %DTE_IDL_PATH%
2121

2222
set WINSDKINC=%WindowsSdkDir%\include
2323
set VSISDKINC=
24+
if "%VSISDKINC%" == "" if not "%VSSDK120Install%" == "" set VSISDKINC=%VSSDK120Install%
2425
if "%VSISDKINC%" == "" if not "%VSSDK110Install%" == "" set VSISDKINC=%VSSDK110Install%
2526
if "%VSISDKINC%" == "" if not "%VSSDK100Install%" == "" set VSISDKINC=%VSSDK100Install%
2627
if "%VSISDKINC%" == "" if not "%VSSDK90Install%" == "" set VSISDKINC=%VSSDK90Install%
@@ -30,8 +31,8 @@ if "%VSISDKINC%" == "" (echo could not detect the Visual Studio SDK && exit /B 1
3031
if not exist "%VSISDKINC%\VisualStudioIntegration\Common\Inc\textmgr.h" (echo unexpected Visual Studio SDK installation at %VSISDKINC% && exit /B 1)
3132

3233
echo Translating Windows SDK and Visual Studio SDK to D, this can take several minutes. Please be patient.
33-
echo %VSI2D% -vsi="%VSISDKINC:\=/%" -win="%WINSDKINC:\=/%" -dte="%DTE_IDL_PATH%" -sdk=..\sdk
34-
%VSI2D% -vsi="%VSISDKINC:\=/%" -win="%WINSDKINC:\=/%" -dte="%DTE_IDL_PATH%" -sdk=..\sdk
34+
echo %VSI2D% --vsi="%VSISDKINC:\=/%" --win="%WINSDKINC:\=/%" --dte="%DTE_IDL_PATH%" --sdk=..\sdk
35+
%VSI2D% --vsi="%VSISDKINC:\=/%" --win="%WINSDKINC:\=/%" --dte="%DTE_IDL_PATH%" --sdk=..\sdk
3536
if errorlevel 1 exit /B 1
3637

3738
echo Translation successful!

build/sdk_libs.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ set LIBS=kernel32.lib user32.lib winspool.lib advapi32.lib
1818
set LIBS=%LIBS% comdlg32.lib gdi32.lib ole32.lib rpcrt4.lib shell32.lib winmm.lib
1919
set LIBS=%LIBS% wsock32.lib comctl32.lib oleaut32.lib ws2_32.lib odbc32.lib
2020

21+
echo WindowsSdkDir=%WindowsSdkDir%
2122
set WINSDKLIB=
23+
if "%WINSDKLIB%" == "" if exist "%WindowsSdkDir%\lib\winv6.3\um\x86\kernel32.lib" set WINSDKLIB=%WindowsSdkDir%\lib\winv6.3\um\x86
2224
if "%WINSDKLIB%" == "" if exist "%WindowsSdkDir%\lib\win8\um\x86\kernel32.lib" set WINSDKLIB=%WindowsSdkDir%\lib\win8\um\x86
2325
if "%WINSDKLIB%" == "" if exist "%WindowsSdkDir%\lib\kernel32.lib" set WINSDKLIB=%WindowsSdkDir%\lib
2426
if "%WINSDKLIB%" == "" (echo could not detect the Windows SDK library folder && exit /B 1)

c2d/idl2d.d

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ class idl2d
136136
"threadpoolprivateapiset.h", "threadpoolapiset.h", "bemapiset.h", "wow64apiset.h",
137137
"jobapi.h", "timezoneapi.h", "datetimeapi.h", "stringapiset.h",
138138
"libloaderapi.h", "securitybaseapi.h", "namespaceapi.h", "systemtopologyapi.h", "processtopologyapi.h",
139-
"securityappcontainer.h", "realtimeapiset.h", "unknwnbase.idl", "objidlbase.idl", "combaseapi.h"
139+
"securityappcontainer.h", "realtimeapiset.h", "unknwnbase.idl", "objidlbase.idl", "combaseapi.h",
140+
// Win SDK 8.1
141+
"mprapidef.h", "lmerr.h", "lmcons.h",
140142
])
141143
win_idl_files ~= f ~ "*"; // make it optional
142144

@@ -1215,6 +1217,11 @@ version(all)
12151217
replaceTokenSequence(tokens, "typedef struct DECLSPEC_ALIGN($_num)", "align($_num) typedef struct", true);
12161218
replaceTokenSequence(tokens, "typedef union DECLSPEC_ALIGN($_num)", "align($_num) typedef union", true);
12171219
replaceTokenSequence(tokens, "struct DECLSPEC_ALIGN($_num)", "align($_num) struct", true);
1220+
1221+
// win 8.1: remove template _ENUM_FLAG_INTEGER_FOR_SIZE
1222+
replaceTokenSequence(tokens, "template $args _ENUM_FLAG_INTEGER_FOR_SIZE;", "/*$0*/", true);
1223+
replaceTokenSequence(tokens, "template <> struct _ENUM_FLAG_INTEGER_FOR_SIZE <$arg> { $def };", "/*$0*/", true);
1224+
replaceTokenSequence(tokens, "template <$arg> struct _ENUM_FLAG_SIZED_INTEGER { $def };", "/*$0*/", true);
12181225
}
12191226

12201227
if(currentModule == "commctrl")
@@ -1494,6 +1501,9 @@ version(none) version(vsi)
14941501
replaceTokenSequence(tokens, "OLECMDIDF_REFRESH_PROMPTIFOFFLINE = 0x2000, OLECMDIDF_REFRESH_THROUGHSCRIPT = 0x4000 $_not,",
14951502
"OLECMDIDF_REFRESH_PROMPTIFOFFLINE = 0x2000,\nOLECMDIDF_REFRESH_THROUGHSCRIPT = 0x4000, $_not", true);
14961503
replaceTokenSequence(tokens, "OLECMDIDF_REFRESH_PROMPTIFOFFLINE = 0x2000 $_not,", "OLECMDIDF_REFRESH_PROMPTIFOFFLINE = 0x2000, $_not", true);
1504+
1505+
// win SDK 8.1: double define
1506+
replaceTokenSequence(tokens, "typedef struct tagPAGESET {} PAGESET;", "", true);
14971507
}
14981508

14991509
//vsshell.idl
@@ -1526,6 +1536,23 @@ version(none) version(vsi)
15261536
{
15271537
replaceTokenSequence(tokens, "typedef enum CWMO_FLAGS", "typedef enum tagCWMO_FLAGS", true);
15281538
}
1539+
if(currentModule == "lmcons")
1540+
{
1541+
replaceTokenSequence(tokens, "alias NERR_BASE MIN_LANMAN_MESSAGE_ID;", "enum MIN_LANMAN_MESSAGE_ID = 2100;", true); // missing lmerr.h
1542+
}
1543+
if(currentModule == "winnt")
1544+
{
1545+
// Win SDK 8.1: remove translation to intrinsics
1546+
replaceTokenSequence(tokens, "alias _InterlockedAnd InterlockedAnd;", "/+ $*", true);
1547+
replaceTokenSequence(tokens, "InterlockedCompareExchange($args __in LONG ExChange, __in LONG Comperand);", "$* +/", true);
1548+
replaceTokenSequence(tokens, "InterlockedOr(&Barrier, 0);", "InterlockedExchangeAdd(&Barrier, 0);", true); // InterlockedOr exist only as intrinsic
1549+
}
1550+
if(currentModule == "ocidl")
1551+
{
1552+
// move alias out of interface declaration, it causes circular definitions with dmd 2.065+
1553+
replaceTokenSequence(tokens, "interface IOleUndoManager : IUnknown { alias IID_IOleUndoManager SID_SOleUndoManager; $data }",
1554+
"interface IOleUndoManager : IUnknown { $data }\n\nalias IID_IOleUndoManager SID_SOleUndoManager;", true);
1555+
}
15291556

15301557
replaceTokenSequence(tokens, "extern const __declspec(selectany)", "dconst", true);
15311558
replaceTokenSequence(tokens, "EXTERN_C $args;", "/+EXTERN_C $args;+/", true);
@@ -1723,6 +1750,10 @@ version(none)
17231750
replaceTokenSequence(tokens, "$_not . UIHierarchyItems*", "$_not . UIHierarchyItems*", true);
17241751
replaceTokenSequence(tokens, "Collection([$data] ProjectItems $arg)", "Collection([$data] .ProjectItems $arg)", true);
17251752
}
1753+
if(currentModule == "dte80a")
1754+
{
1755+
replaceTokenSequence(tokens, "[id($_num), propputref $attr] HRESULT Value", "[id($_num), propputref $attr]\nHRESULT putref_Value", true);
1756+
}
17261757
// VS2012 SDK
17271758
if(currentModule == "webproperties")
17281759
{
@@ -1874,6 +1905,11 @@ version(all) {
18741905
replaceTokenSequence(tokens, "_Acquires_exclusive_lock_($args)", "/+$*+/", true);
18751906
replaceTokenSequence(tokens, "_Acquires_shared_lock_($args)", "/+$*+/", true);
18761907

1908+
// Win SDK 8.1
1909+
replaceTokenSequence(tokens, "_Post_satisfies_($args)", "/+$*+/", true);
1910+
replaceTokenSequence(tokens, "_Post_readable_byte_size_($args)", "/+$*+/", true);
1911+
replaceTokenSequence(tokens, "_Ret_reallocated_bytes_($args)", "/+$*+/", true);
1912+
18771913
replaceTokenSequence(tokens, "__assume_bound($args);", "/+$*+/", true);
18781914
replaceTokenSequence(tokens, "__asm{$args}$_opt;", "assert(false, \"asm not translated\"); asm{naked; nop; /+$args+/}", true);
18791915
replaceTokenSequence(tokens, "__asm $_not{$stmt}", "assert(false, \"asm not translated\"); asm{naked; nop; /+$_not $stmt+/} }", true);
@@ -2170,6 +2206,11 @@ else
21702206
case "_Ret_maybenull_":
21712207
case "_Ret_opt_":
21722208
case "_Printf_format_string_":
2209+
2210+
// Windows SDK 8.1
2211+
case "_Field_z_":
2212+
case "_Pre_notnull_":
2213+
case "_Frees_ptr_":
21732214
return "/*" ~ text ~ "*/";
21742215

21752216
case "__checkReturn": return "/*__checkReturn*/";

sdk/port/base.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ alias void WriteULongPtrRelease;
422422
alias void WriteULongPtrNoFence;
423423
alias void WriteULongPtrRaw;
424424

425+
extern(C) DWORD __readfsdword (DWORD Offset) { asm { naked; mov EAX,[ESP+4]; mov EAX, FS:[EAX]; } }
426+
425427
enum TRUE = 1;
426428
public import sdk.win32.winbase;
427429
//enum FALSE = 0;

0 commit comments

Comments
 (0)