Subject: | [PATCH] C90 declaration-after-statement error with darwin threads |
This is invalid.
HiRes.xs: In function 'darwin_time_init':
HiRes.xs:773:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
struct timeval tv;
^
static int darwin_time_init() {
#ifdef USE_ITHREADS
MUTEX_LOCK(&darwin_time_mutex);
#endif
struct timeval tv;
int success = 1;
Patch attached.
git am -p2, as I needed it in core.
--
Reini Urban
Subject: | 0001-Time-Hires-Fix-declaration-after-statement-error-wit.patch |
From 7ef5ccaf84a5af9748342c434eefa39cbff63314 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Mon, 18 Apr 2016 09:38:13 +0200
Subject: [PATCH] Time-Hires: Fix declaration-after-statement error with darwin
threads
---
cpan/Time-HiRes/HiRes.xs | 4 ++--
diff --git cpan/Time-HiRes/HiRes.xs cpan/Time-HiRes/HiRes.xs
index 8b8f25c..38ca0dc 100644
--- cpan/Time-HiRes/HiRes.xs
+++ cpan/Time-HiRes/HiRes.xs
@@ -767,11 +767,11 @@ static mach_timebase_info_data_t timebase_info;
static struct timespec timespec_init;
static int darwin_time_init() {
+ struct timeval tv;
+ int success = 1;
#ifdef USE_ITHREADS
MUTEX_LOCK(&darwin_time_mutex);
#endif
- struct timeval tv;
- int success = 1;
if (absolute_time_init == 0) {
/* mach_absolute_time() cannot fail */
absolute_time_init = mach_absolute_time();
--
2.8.1