Skip to content

Commit

Permalink
Test compilation with clang-cl
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Aug 18, 2023
1 parent 5337b9e commit 4135097
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion scripts/windows-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mkdir %BUILD_DIR%
cd %BUILD_DIR%
cmake --version || EXIT /B 1
cmake -DCMAKE_UNITY_BUILD=%UNITY_BUILD% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -GNinja ^
-DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ^
-DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_CXX_COMPILER="clang-cl.exe" ^
.. || EXIT /B 1
type variables.bat
call variables.bat
Expand Down
6 changes: 3 additions & 3 deletions source/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")

# Only do MSVC code analysis on CI
if(DEFINED ENV{CI})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /analyze")
endif()
#if(DEFINED ENV{CI})
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /analyze")
#endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
/DYNAMICBASE /NXCOMPAT /MAP /debug")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

/* For (MDException).exception_code. These values come from bits/signum.h.
*/
typedef enum {
typedef enum : uint32_t {
MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */
Expand Down Expand Up @@ -86,7 +86,7 @@ typedef enum {
/* For (MDException).exception_flags. These values come from
* asm-generic/siginfo.h.
*/
typedef enum {
typedef enum : uint32_t {
/* SIGILL */
MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC = 1,
MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include "google_breakpad/common/breakpad_types.h"

typedef enum {
typedef enum : uint32_t {
MD_EXCEPTION_CODE_PS3_UNKNOWN = 0,
MD_EXCEPTION_CODE_PS3_TRAP_EXCEP = 1,
MD_EXCEPTION_CODE_PS3_PRIV_INSTR = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

/* For (MDException).exception_code. These values come from sys/iso/signal_iso.h
*/
typedef enum {
typedef enum : uint32_t {
MD_EXCEPTION_CODE_SOL_SIGHUP = 1, /* Hangup */
MD_EXCEPTION_CODE_SOL_SIGINT = 2, /* interrupt (rubout) */
MD_EXCEPTION_CODE_SOL_SIGQUIT = 3, /* quit (ASCII FS) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/* For (MDException).exception_code. These values come from WinBase.h
* and WinNT.h (names beginning with EXCEPTION_ are in WinBase.h,
* they are STATUS_ in WinNT.h). */
typedef enum {
typedef enum : uint32_t {
MD_EXCEPTION_CODE_WIN_CONTROL_C = 0x40010005,
/* DBG_CONTROL_C */
MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION = 0x80000001,
Expand Down Expand Up @@ -131,7 +131,7 @@ typedef enum {
* | pbcopy # on mac
*
* and then the last comma manually removed. */
typedef enum {
typedef enum : uint32_t {
MD_NTSTATUS_WIN_STATUS_UNSUCCESSFUL = 0xC0000001,
MD_NTSTATUS_WIN_STATUS_NOT_IMPLEMENTED = 0xC0000002,
MD_NTSTATUS_WIN_STATUS_INVALID_INFO_CLASS = 0xC0000003,
Expand Down Expand Up @@ -2251,23 +2251,23 @@ typedef enum {

// These constants are defined in the MSDN documentation of
// the EXCEPTION_RECORD structure.
typedef enum {
typedef enum : uint32_t {
MD_ACCESS_VIOLATION_WIN_READ = 0,
MD_ACCESS_VIOLATION_WIN_WRITE = 1,
MD_ACCESS_VIOLATION_WIN_EXEC = 8
} MDAccessViolationTypeWin;

// These constants are defined in the MSDN documentation of
// the EXCEPTION_RECORD structure.
typedef enum {
typedef enum : uint32_t {
MD_IN_PAGE_ERROR_WIN_READ = 0,
MD_IN_PAGE_ERROR_WIN_WRITE = 1,
MD_IN_PAGE_ERROR_WIN_EXEC = 8
} MDInPageErrorTypeWin;

// These constants are defined in winnt.h and are used with the
// STATUS_STACK_BUFFER_OVERRUN exception as exception subcodes.
typedef enum {
typedef enum : uint32_t {
MD_FAST_FAIL_LEGACY_GS_VIOLATION = 0,
MD_FAST_FAIL_VTGUARD_CHECK_FAILURE = 1,
MD_FAST_FAIL_STACK_COOKIE_CHECK_FAILURE = 2,
Expand Down
8 changes: 4 additions & 4 deletions source/thirdparty/cryptopp/config_cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

// Ancient Crypto++ define, dating back to C++98.
#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
# define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 1
# define CRYPTOPP_CXX98_UNCAUGHT_EXCEPTION 1
//# define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 1
//# define CRYPTOPP_CXX98_UNCAUGHT_EXCEPTION 1
#endif

// Compatibility with non-clang compilers.
Expand Down Expand Up @@ -229,12 +229,12 @@
#if defined(__clang__)
# if __EXCEPTIONS && __has_feature(cxx_exceptions)
# if __cpp_lib_uncaught_exceptions >= 201411L
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
//# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
# endif
# endif
#elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || \
(CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions >= 201411L)
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
//# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
#endif // uncaught_exceptions compilers

#endif // CRYPTOPP_CXX17
Expand Down
2 changes: 1 addition & 1 deletion source/thirdparty/cryptopp/config_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// Some relevant bug reports can be found at:
// * Clang: http://github.com/weidai11/cryptopp/issues/147
#if (defined(_MSC_VER) && defined(__clang__) && !(defined( __clang_analyzer__)))
# error: "Unsupported configuration"
//# error: "Unsupported configuration"
#endif

// Windows platform
Expand Down

0 comments on commit 4135097

Please sign in to comment.