Skip to content

Commit 33113ae

Browse files
committed
Correct unity math for ARMC6
The assumed that isnan and isinf would be macros, but they are functions in ARMC6.
1 parent 8a9d79b commit 33113ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

features/frameworks/unity/unity/unity_internals.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ typedef _US64 _U_SINT;
227227
#endif
228228
typedef UNITY_FLOAT_TYPE _UF;
229229

230+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
231+
#else
232+
230233
#ifndef isinf
231234
#define isinf(n) (((1.0f / f_zero) == n) ? 1 : 0) || (((-1.0f / f_zero) == n) ? 1 : 0)
232235
#define UNITY_FLOAT_NEEDS_ZERO
@@ -236,6 +239,8 @@ typedef UNITY_FLOAT_TYPE _UF;
236239
#define isnan(n) ((n != n) ? 1 : 0)
237240
#endif
238241

242+
#endif /* ARMC6 */
243+
239244
#ifndef isneg
240245
#define isneg(n) ((n < 0.0f) ? 1 : 0)
241246
#endif

0 commit comments

Comments
 (0)