Skip to content

Commit

Permalink
Merge branch 'topic/vadim/winfixes' into 'master'
Browse files Browse the repository at this point in the history
Fix build failure on Windows 32bit

Closes eng/libadalang/prettier-ada#3

See merge request eng/ide/VSS!295
  • Loading branch information
godunko committed Nov 23, 2023
2 parents 5d50bb7 + 77cc26f commit db3d105
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions gnat/vss_text.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ library project VSS_Text is
case VSS_Common.Library_Kind is
when "relocatable" =>
OS_Library_Options := ("-luserenv");
-- `userenv` has been added explicitly to fix link failure.
when others=>
null;
end case;
Expand Down
4 changes: 2 additions & 2 deletions source/os/windows/vss-implementation-windows-advapi32.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022, AdaCore
-- Copyright (C) 2022-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand All @@ -15,6 +15,6 @@ package VSS.Implementation.Windows.Advapi32 is
DesiredAccess : DWORD;
TokenHandle : out HANDLE)
return BOOL
with Import, Convention => Stdcall, Link_Name => "OpenProcessToken";
with Import, Convention => Stdcall, External_Name => "OpenProcessToken";

end VSS.Implementation.Windows.Advapi32;
24 changes: 12 additions & 12 deletions source/os/windows/vss-implementation-windows-kernel32.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022, AdaCore
-- Copyright (C) 2022-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand Down Expand Up @@ -37,50 +37,50 @@ package VSS.Implementation.Windows.Kernel32 is
STARTF_USESTDHANDLES : constant DWORD := 16#0000_0100#;

function CloseHandle (hObject : HANDLE) return BOOL
with Import, Convention => Stdcall, Link_Name => "CloseHandle";
with Import, Convention => Stdcall, External_Name => "CloseHandle";

function GetCommandLine return LPWSTR
with Import, Convention => Stdcall, Link_Name => "GetCommandLineW";
with Import, Convention => Stdcall, External_Name => "GetCommandLineW";

function GetConsoleWindow return HWND
with Import, Convention => Stdcall, Link_Name => "GetConsoleWindow";
with Import, Convention => Stdcall, External_Name => "GetConsoleWindow";

function GetCurrentProcess return HANDLE
with Import, Convention => Stdcall, Link_Name => "GetCurrentProcess";
with Import, Convention => Stdcall, External_Name => "GetCurrentProcess";

function GetLastError return DWORD
with Import, Convention => Stdcall, Link_Name => "GetLastError";
with Import, Convention => Stdcall, External_Name => "GetLastError";

function GetEnvironmentVariable
(lpName : LPCWSTR;
lpBuffer : LPWSTR;
nSize : DWORD) return DWORD
with Import,
Convention => Stdcall,
Link_Name => "GetEnvironmentVariableW";
External_Name => "GetEnvironmentVariableW";

procedure GetStartupInfo
(lpStartupInfo : Kernel32.LPSTARTUPINFO)
with Import, Convention => StdCall, Link_Name => "GetStartupInfoW";
with Import, Convention => StdCall, External_Name => "GetStartupInfoW";

function GetTempPath
(nBufferLength : DWORD;
lpBuffer : LPWSTR) return DWORD
with Import, Convention => Stdcall, Link_Name => "GetTempPathW";
with Import, Convention => Stdcall, External_Name => "GetTempPathW";

function GetLongPathName
(lpszShortPath : LPCWSTR;
lpszLongPath : LPWSTR;
cchBuffer : DWORD) return DWORD
with Import, Convention => Stdcall, Link_Name => "GetLongPathNameW";
with Import, Convention => Stdcall, External_Name => "GetLongPathNameW";

function GetModuleFileName
(hModule : HANDLE;
lpFilename : LPWSTR;
nSize : DWORD) return DWORD
with Import, Convention => StdCall, Link_Name => "GetModuleFileNameW";
with Import, Convention => StdCall, External_Name => "GetModuleFileNameW";

procedure LocalFree (hMem : LPWSTR_Pointer)
with Import, Convention => StdCall, Link_Name => "LocalFree";
with Import, Convention => StdCall, External_Name => "LocalFree";

end VSS.Implementation.Windows.Kernel32;
4 changes: 2 additions & 2 deletions source/os/windows/vss-implementation-windows-shell32.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022, AdaCore
-- Copyright (C) 2022-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand All @@ -13,6 +13,6 @@ package VSS.Implementation.Windows.Shell32 is
function CommandLineToArgv
(lpCmdLine : LPCWSTR;
pNumArgs : out Interfaces.C.int) return LPWSTR_Pointer
with Import, Convention => Stdcall, Link_Name => "CommandLineToArgvW";
with Import, Convention => Stdcall, External_Name => "CommandLineToArgvW";

end VSS.Implementation.Windows.Shell32;
4 changes: 2 additions & 2 deletions source/os/windows/vss-implementation-windows-user32.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022, AdaCore
-- Copyright (C) 2022-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand All @@ -21,6 +21,6 @@ package VSS.Implementation.Windows.User32 is
lpText : LPCWSTR;
lpCaption : LPCWSTR;
uType : UINT) return Interfaces.C.int
with Import, Convention => StdCall, Link_Name => "MessageBoxW";
with Import, Convention => StdCall, External_Name => "MessageBoxW";

end VSS.Implementation.Windows.User32;
4 changes: 2 additions & 2 deletions source/os/windows/vss-implementation-windows-userenv.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022, AdaCore
-- Copyright (C) 2022-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand All @@ -17,6 +17,6 @@ package VSS.Implementation.Windows.Userenv is
return BOOL
with Import,
Convention => Stdcall,
Link_Name => "GetUserProfileDirectoryW";
External_Name => "GetUserProfileDirectoryW";

end VSS.Implementation.Windows.Userenv;

0 comments on commit db3d105

Please sign in to comment.