aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h
diff options
context:
space:
mode:
authorMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-03-01 03:58:37 +0800
committerMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-03-03 11:29:34 +0800
commitde9f79133faa1ff5dcd16fb4fd13d06b7799ded9 (patch)
treefcc9001d6b681ccdd1b3bbe516e3611e808341d7 /Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h
parent080823bdeebbab2bcffdaefad703896700ed2c30 (diff)
downloadgo-tangerine-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.gz
go-tangerine-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.zst
go-tangerine-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.zip
Introducing ethash
Diffstat (limited to 'Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h')
-rw-r--r--Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h b/Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h
new file mode 100644
index 000000000..2f59076f6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/ethereum/ethash/libethash/util.h
@@ -0,0 +1,47 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file util.h
+ * @author Tim Hughes <tim@twistedfury.com>
+ * @date 2015
+ */
+#pragma once
+#include <stdint.h>
+#include "compiler.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _MSC_VER
+void debugf(const char *str, ...);
+#else
+#define debugf printf
+#endif
+
+static inline uint32_t min_u32(uint32_t a, uint32_t b)
+{
+ return a < b ? a : b;
+}
+
+static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_)
+{
+ return x < min_ ? min_ : (x > max_ ? max_ : x);
+}
+
+#ifdef __cplusplus
+}
+#endif