Files
haikuports/app-benchmarks/bonnie++/patches/bonnie++-2.00a.gcc2.patchset
2021-11-22 23:02:50 +03:00

44 lines
1.2 KiB
Plaintext

From ca2474642f424d6b634611e5e670b8c584e89ff3 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu Sep 26 19:18:42 2019 +0200
Subject: gcc2 patch
diff --git a/Makefile.in b/Makefile.in
index 6dfdb75..8f612a9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -8,7 +8,7 @@ SCRIPTS=bon_csv2txt
prefix=@prefix@
eprefix=@exec_prefix@
#MORE_WARNINGS=-Weffc++
-WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security -Wswitch-enum -Winit-self $(MORE_WARNINGS)
+WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -Wcast-align -Wsign-compare -Wpointer-arith -Wwrite-strings -Wformat-security $(MORE_WARNINGS)
CFLAGS=-O2 @debug@ -DNDEBUG $(WFLAGS) $(MORECFLAGS)
CXX=@CXX@ $(CFLAGS)
LINK=@CXX@
diff --git a/bon_time.cpp b/bon_time.cpp
index 2da4f3d..f0da4af 100644
--- a/bon_time.cpp
+++ b/bon_time.cpp
@@ -6,6 +6,16 @@
#include <time.h>
#include <string.h>
+/* min and max comparisons */
+#if defined(__GNUC__) && __GNUC__ < 3
+# ifndef min
+# define min(a,b) ((a)>(b)?(b):(a))
+# endif
+# ifndef max
+# define max(a,b) ((a)>(b)?(a):(b))
+# endif
+#endif
+
void BonTimer::start()
{
m_dur.start();
--
2.30.2