Skip to content

Commit

Permalink
trace.c: do not mark getnanotime() as "inline"
Browse files Browse the repository at this point in the history
Oracle Studio compilers don't allow for static variables in
functions that are defined to be inline. GNU C does permit this.

Let's reference the C99 standard though, which doesn't allow for
inline functions to contain modifiable static variables.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ben Walton authored and Junio C Hamano committed Sep 29, 2014
1 parent 62b553c commit 6433d56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static inline uint64_t gettimeofday_nanos(void)
* Returns nanoseconds since the epoch (01/01/1970), for performance tracing
* (i.e. favoring high precision over wall clock time accuracy).
*/
inline uint64_t getnanotime(void)
uint64_t getnanotime(void)
{
static uint64_t offset;
if (offset > 1) {
Expand Down

0 comments on commit 6433d56

Please sign in to comment.