Skip to content

Commit

Permalink
Fix MSVC warning overrides when using non-MSVC toolchains
Browse files Browse the repository at this point in the history
The checks should detect MSVC instead of the OS type.
  • Loading branch information
oleavr committed Jan 18, 2024
1 parent 25a69b5 commit c3807ea
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MathExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#endif

#ifndef __cplusplus
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#define inline /* inline */
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/X86/X86ATTInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// this code is only relevant when DIET mode is disable
#if defined(CAPSTONE_HAS_X86) && !defined(CAPSTONE_DIET) && !defined(CAPSTONE_X86_ATT_DISABLE)

#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable:4996) // disable MSVC's warning on strncpy()
#pragma warning(disable:28719) // disable MSVC's warning on strncpy()
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/X86/X86Disassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

#ifdef CAPSTONE_HAS_X86

#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable:4996) // disable MSVC's warning on strncpy()
#pragma warning(disable:28719) // disable MSVC's warning on strncpy()
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/X86/X86InstPrinterCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */

#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable:4996) // disable MSVC's warning on strncpy()
#pragma warning(disable:28719) // disable MSVC's warning on strncpy()
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/X86/X86IntelInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#ifdef CAPSTONE_HAS_X86

#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable:4996) // disable MSVC's warning on strncpy()
#pragma warning(disable:28719) // disable MSVC's warning on strncpy()
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/XCore/XCoreInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#ifdef CAPSTONE_HAS_XCORE

#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable : 4996) // disable MSVC's warning on strcpy()
#pragma warning(disable : 28719) // disable MSVC's warning on strcpy()
#endif
Expand Down
2 changes: 1 addition & 1 deletion cs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
#ifdef _MSC_VER
#pragma warning(disable:4996) // disable MSVC's warning on strcpy()
#pragma warning(disable:28719) // disable MSVC's warning on strcpy()
#endif
Expand Down

0 comments on commit c3807ea

Please sign in to comment.