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/B-C/lib/B/Asmdata.pm | 20 ++++++++++----------
cpan/Time-HiRes/HiRes.xs | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git cpan/B-C/lib/B/Asmdata.pm cpan/B-C/lib/B/Asmdata.pm
index ed9fd1e..44a397c 100644
--- cpan/B-C/lib/B/Asmdata.pm
+++ cpan/B-C/lib/B/Asmdata.pm
@@ -10,7 +10,7 @@
#
#
# This file is autogenerated from bytecode.pl. Changes made here will be lost.
-# It is specific for cperl 5.022002-nt only.
+# It is specific for cperl 5.022002 only.
#
package B::Asmdata;
@@ -137,9 +137,8 @@ $insn_data{op_last} = [103, \&PUT_opindex, "GET_opindex"];
$insn_data{op_other} = [104, \&PUT_opindex, "GET_opindex"];
$insn_data{op_pmreplroot} = [105, \&PUT_opindex, "GET_opindex"];
$insn_data{op_pmreplstart} = [106, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_pmstashpv} = [108, 0, "GET_pvindex"];
-$insn_data{op_pmstash} = [110, \&PUT_svindex, "GET_svindex"];
-$insn_data{op_pmreplrootgv} = [111, \&PUT_svindex, "GET_svindex"];
+$insn_data{op_pmstashpv} = [108, \&PUT_pvindex, "GET_pvindex"];
+$insn_data{op_pmreplrootpo} = [109, \&PUT_PADOFFSET, "GET_PADOFFSET"];
$insn_data{pregcomp} = [112, \&PUT_pvcontents, "GET_pvcontents"];
$insn_data{op_pmflags} = [113, \&PUT_pmflags, "GET_pmflags"];
$insn_data{op_pmpermflags} = [114, 0, "GET_U16"];
@@ -152,10 +151,10 @@ $insn_data{op_redoop} = [120, \&PUT_opindex, "GET_opindex"];
$insn_data{op_nextop} = [121, \&PUT_opindex, "GET_opindex"];
$insn_data{op_lastop} = [122, \&PUT_opindex, "GET_opindex"];
$insn_data{cop_label} = [123, \&PUT_pvindex, "GET_pvindex"];
-$insn_data{cop_stashpv} = [124, 0, "GET_pvindex"];
-$insn_data{cop_file} = [125, 0, "GET_pvindex"];
-$insn_data{cop_stash} = [126, \&PUT_svindex, "GET_svindex"];
-$insn_data{cop_filegv} = [127, \&PUT_svindex, "GET_svindex"];
+$insn_data{cop_stashpv} = [124, \&PUT_pvindex, "GET_pvindex"];
+$insn_data{cop_file} = [125, \&PUT_pvindex, "GET_pvindex"];
+$insn_data{cop_stash} = [126, 0, "GET_svindex"];
+$insn_data{cop_filegv} = [127, 0, "GET_svindex"];
$insn_data{cop_seq} = [128, \&PUT_U32, "GET_U32"];
$insn_data{cop_arybase} = [129, 0, "GET_I32"];
$insn_data{cop_line} = [130, \&PUT_U32, "GET_U32"];
@@ -173,6 +172,7 @@ $insn_data{defstash} = [141, \&PUT_svindex, "GET_svindex"];
$insn_data{data} = [142, \&PUT_U8, "GET_U8"];
$insn_data{incav} = [143, \&PUT_svindex, "GET_svindex"];
$insn_data{load_glob} = [144, \&PUT_svindex, "GET_svindex"];
+$insn_data{regex_padav} = [145, \&PUT_svindex, "GET_svindex"];
$insn_data{dowarn} = [146, \&PUT_U8, "GET_U8"];
$insn_data{comppad_name} = [147, \&PUT_svindex, "GET_svindex"];
$insn_data{xgv_stash} = [148, \&PUT_svindex, "GET_svindex"];
@@ -212,8 +212,8 @@ $insn_data{padn_pv} = [181, \&PUT_strconst, "GET_strconst"];
$insn_data{padn_flags} = [182, \&PUT_U8, "GET_U8"];
$insn_data{unop_aux} = [183, \&PUT_strconst, "GET_strconst"];
$insn_data{methop_methsv} = [184, \&PUT_svindex, "GET_svindex"];
-$insn_data{methop_rclass} = [185, \&PUT_svindex, "GET_svindex"];
-$insn_data{methop_rclass} = [186, 0, "GET_PADOFFSET"];
+$insn_data{methop_rclass} = [185, 0, "GET_svindex"];
+$insn_data{methop_rclass} = [186, \&PUT_PADOFFSET, "GET_PADOFFSET"];
my ($insn_name, $insn_data);
while (($insn_name, $insn_data) = each %insn_data) {
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