Conditionalize uses of C99 restrict keyword

This is part of C99, but not part of Standard C++, so it can't be used
unconditionally if the sysprof headers might get included into C++ code.

Resolves: https://gitlab.gnome.org/GNOME/sysprof/-/issues/114
Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
Simon McVittie
2024-02-24 11:38:47 +00:00
parent 4126a76727
commit 36f4988ecc
3 changed files with 4 additions and 2 deletions

View File

@ -60,7 +60,7 @@ sysprof_time_span_relative_to (SysprofTimeSpan time_span,
static inline void
sysprof_time_span_normalize (SysprofTimeSpan time_span,
SysprofTimeSpan allowed,
float values[restrict 2])
float values[SYSPROF_RESTRICT 2])
{
double duration = allowed.end_nsec - allowed.begin_nsec;