From 09793e32068ac7a8ad0bd453a12368d692cab5d8 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 17 Nov 2015 08:52:12 -0800 Subject: [PATCH] Added benchmark.h to expose the benchmark_test function. Updated a couple of projects to use the new benchmark header. --- .../Projects/benchmark/benchmark-main.c | 4 +-- IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c | 4 +-- wolfcrypt/benchmark/benchmark.c | 1 + wolfcrypt/benchmark/benchmark.h | 32 +++++++++++++++++++ wolfcrypt/benchmark/include.am | 1 + wolfcrypt/test/test.h | 2 +- 6 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 wolfcrypt/benchmark/benchmark.h diff --git a/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c b/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c index d8f559d4c..cdb8efd26 100644 --- a/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c +++ b/IDE/IAR-EWARM/Projects/benchmark/benchmark-main.c @@ -24,6 +24,7 @@ #endif #include +#include typedef struct func_args { int argc; @@ -34,11 +35,8 @@ typedef struct func_args { func_args args = { 0 } ; extern double current_time(int reset) ; -extern int benchmark_test(void *args) ; main(void) { benchmark_test(&args) ; return 0; } - - diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c b/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c index 99cf1fbc9..9d3891e62 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/benchmark_main.c @@ -24,6 +24,7 @@ #endif #include +#include #include typedef struct func_args { @@ -34,8 +35,7 @@ typedef struct func_args { static func_args args = { 0 } ; -extern double current_time(int reset) ; -extern int benchmark_test(void *args) ; +extern double current_time(int reset); void main(void) { diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index f36563d4c..723194418 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -122,6 +122,7 @@ #pragma warning(disable: 4996) #endif +#include "wolfcrypt/benchmark/benchmark.h" void bench_des(void); void bench_idea(void); diff --git a/wolfcrypt/benchmark/benchmark.h b/wolfcrypt/benchmark/benchmark.h new file mode 100644 index 000000000..3905eebf7 --- /dev/null +++ b/wolfcrypt/benchmark/benchmark.h @@ -0,0 +1,32 @@ +/* wolfcrypt/benchmark/benchmark.h + * + * Copyright (C) 2006-2015 wolfSSL Inc. + * + * This file is part of wolfSSL. (formerly known as CyaSSL) + * + * wolfSSL 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 2 of the License, or + * (at your option) any later version. + * + * wolfSSL 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma once + +#ifdef __cplusplus + extern "C" { +#endif + +int benchmark_test(void* args); + +#ifdef __cplusplus + } /* extern "C" */ +#endif diff --git a/wolfcrypt/benchmark/include.am b/wolfcrypt/benchmark/include.am index eee26235f..f147883da 100644 --- a/wolfcrypt/benchmark/include.am +++ b/wolfcrypt/benchmark/include.am @@ -5,6 +5,7 @@ noinst_PROGRAMS += wolfcrypt/benchmark/benchmark wolfcrypt_benchmark_benchmark_SOURCES = wolfcrypt/benchmark/benchmark.c wolfcrypt_benchmark_benchmark_LDADD = src/libwolfssl.la $(LIB_STATIC_ADD) wolfcrypt_benchmark_benchmark_DEPENDENCIES = src/libwolfssl.la +noinst_HEADERS += wolfcrypt/benchmark/benchmark.h EXTRA_DIST += wolfcrypt/benchmark/benchmark.sln EXTRA_DIST += wolfcrypt/benchmark/benchmark.vcproj DISTCLEANFILES+= wolfcrypt/benchmark/.libs/benchmark diff --git a/wolfcrypt/test/test.h b/wolfcrypt/test/test.h index dbe6e25e0..6f9b6bd14 100644 --- a/wolfcrypt/test/test.h +++ b/wolfcrypt/test/test.h @@ -1,4 +1,4 @@ -/* ctaocrypt/test/test.h +/* wolfcrypt/test/test.h * * Copyright (C) 2006-2015 wolfSSL Inc. *