Skip to content

Commit

Permalink
Undef ASSERT before defining it to ensure that no previous definition
Browse files Browse the repository at this point in the history
has sneaked in through included files.

Signed-off-by: Ouss4 <abdelatif.guettouche@gmail.com>
  • Loading branch information
Ouss4 committed Aug 12, 2020
1 parent 0ca6d38 commit 507f4b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.d/undef_assert_befor_defining_it.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Changes
* Undefine the ASSERT macro before defining it locally, in case it is defined
in a platform header. Contributed by Abdelatif Guettouche in #3557.
3 changes: 3 additions & 0 deletions library/chacha20.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ static const size_t test_lengths[2] =
375U
};

/* Make sure no other definition is already present. */
#undef ASSERT

#define ASSERT( cond, args ) \
do \
{ \
Expand Down
3 changes: 3 additions & 0 deletions library/chachapoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ static const unsigned char test_mac[1][16] =
}
};

/* Make sure no other definition is already present. */
#undef ASSERT

#define ASSERT( cond, args ) \
do \
{ \
Expand Down
3 changes: 3 additions & 0 deletions library/poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ static const unsigned char test_mac[2][16] =
}
};

/* Make sure no other definition is already present. */
#undef ASSERT

#define ASSERT( cond, args ) \
do \
{ \
Expand Down

0 comments on commit 507f4b5

Please sign in to comment.