tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

49_no_invalid_constexpr_enums.patch (2121B)


      1 Remove the constexpr invalid enums, since they are not accepted by clang-20.
      2 
      3 diff --git a/sandbox/win/src/nt_internals.h b/sandbox/win/src/nt_internals.h
      4 index 485215fc82c5..ed63f04a8003 100644
      5 --- a/sandbox/win/src/nt_internals.h
      6 +++ b/sandbox/win/src/nt_internals.h
      7 @@ -37,20 +37,17 @@ typedef NTSTATUS(WINAPI* NtOpenFileFunction)(OUT PHANDLE FileHandle,
      8                                              OUT PIO_STATUS_BLOCK IoStatusBlock,
      9                                              IN ULONG ShareAccess,
     10                                              IN ULONG OpenOptions);
     11 
     12 typedef NTSTATUS(WINAPI* NtCloseFunction)(IN HANDLE Handle);
     13 
     14 #if !defined(__MINGW32__)
     15 // Uses undocumented value not in FILE_INFORMATION_CLASS.
     16 -#pragma clang diagnostic push
     17 -#pragma clang diagnostic ignored "-Wenum-constexpr-conversion"
     18 -constexpr auto FileRenameInformation = static_cast<FILE_INFORMATION_CLASS>(10);
     19 -#pragma clang diagnostic push
     20 +const auto FileRenameInformation = static_cast<FILE_INFORMATION_CLASS>(10);
     21 
     22 typedef struct _FILE_RENAME_INFORMATION {
     23   BOOLEAN ReplaceIfExists;
     24   HANDLE RootDirectory;
     25   ULONG FileNameLength;
     26   WCHAR FileName[1];
     27 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
     28 #endif
     29 @@ -173,20 +170,17 @@ typedef NTSTATUS(WINAPI* NtOpenSectionFunction)(
     30 
     31 typedef NTSTATUS(WINAPI* NtSetInformationThreadFunction)(
     32     IN HANDLE ThreadHandle,
     33     IN THREADINFOCLASS ThreadInformationClass,
     34     IN PVOID ThreadInformation,
     35     IN ULONG ThreadInformationLength);
     36 
     37 // Partial definition only for values not in PROCESS_INFO_CLASS.
     38 -#pragma clang diagnostic push
     39 -#pragma clang diagnostic ignored "-Wenum-constexpr-conversion"
     40 -constexpr auto ProcessHandleTable = static_cast<PROCESSINFOCLASS>(58);
     41 -#pragma clang diagnostic pop
     42 +const auto ProcessHandleTable = static_cast<PROCESSINFOCLASS>(58);
     43 
     44 // Partial definition only adding fields not in winternl.h, from
     45 // https://msdn.microsoft.com/en-us/library/windows/desktop/aa813706(v=vs.85).aspx
     46 typedef struct _NT_PEB {
     47   BYTE InheritedAddressSpace;
     48   BYTE ReadImageFileExecOptions;
     49   BYTE BeingDebugged;
     50   BYTE SpareBool;