Skip to content

Commit

Permalink
Workaround Uncrustify parsing of "asm"
Browse files Browse the repository at this point in the history
The following code:

 #ifndef asm
 #define asm __asm
 #endif

causes Uncrustify to stop correcting the rest of the file. This may be
due to parsing the "asm" keyword in the definition.

Work around this by wrapping the idiom in an *INDENT-OFF* comment
wherever it appears.

Signed-off-by: David Horstmann <[email protected]>
  • Loading branch information
davidhorstmann-arm committed Jan 3, 2023
1 parent a6ad7f4 commit b6bf5f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@

#if defined(MBEDTLS_HAVE_ASM)

/* *INDENT-OFF* */
#ifndef asm
#define asm __asm
#endif
/* *INDENT-ON* */

/* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */
#if defined(__GNUC__) && \
Expand Down
2 changes: 2 additions & 0 deletions library/aesni.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@

#include <string.h>

/* *INDENT-OFF* */
#ifndef asm
#define asm __asm
#endif
/* *INDENT-ON* */

#if defined(MBEDTLS_HAVE_X86_64)

Expand Down
2 changes: 2 additions & 0 deletions library/padlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@

#include <string.h>

/* *INDENT-OFF* */
#ifndef asm
#define asm __asm
#endif
/* *INDENT-ON* */

#if defined(MBEDTLS_HAVE_X86)

Expand Down
2 changes: 2 additions & 0 deletions library/timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
#error "This module only works on Unix and Windows, see MBEDTLS_TIMING_C in config.h"
#endif

/* *INDENT-OFF* */
#ifndef asm
#define asm __asm
#endif
/* *INDENT-ON* */

#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)

Expand Down

0 comments on commit b6bf5f5

Please sign in to comment.