aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2011-07-19 16:18:19 +0200
committerChristophe Lyon <christophe.lyon@st.com>2011-07-19 16:18:19 +0200
commit6f4d36f3deebf87b2710b5b7b5b30e8b2b60c285 (patch)
treeaf991e1c3267172fe8acd34f6abf68738c12da68
parentf54628c9da16e84c1dcc14107cdd3ae7623400e1 (diff)
downloadplatform_external_arm-neon-tests-6f4d36f3deebf87b2710b5b7b5b30e8b2b60c285.tar.gz
platform_external_arm-neon-tests-6f4d36f3deebf87b2710b5b7b5b30e8b2b60c285.tar.bz2
platform_external_arm-neon-tests-6f4d36f3deebf87b2710b5b7b5b30e8b2b60c285.zip
Merge from SVN #514
[CL] fixes to support compilation with a C++ compiler
-rw-r--r--compute_ref.c5
-rw-r--r--ref_dsp.c5
-rw-r--r--ref_dspfns.c11
-rw-r--r--ref_integer.c5
-rw-r--r--ref_vaddhn.c4
-rw-r--r--retarget.c4
-rw-r--r--stm-arm-neon-ref.h12
7 files changed, 40 insertions, 6 deletions
diff --git a/compute_ref.c b/compute_ref.c
index 6ec7724..f270192 100644
--- a/compute_ref.c
+++ b/compute_ref.c
@@ -23,8 +23,13 @@ THE SOFTWARE.
*/
+#if defined(__cplusplus)
+#include <cstdio>
+#include <cstdlib>
+#else
#include <stdio.h>
#include <stdlib.h>
+#endif
FILE* log_file = NULL;
FILE* ref_file = NULL;
diff --git a/ref_dsp.c b/ref_dsp.c
index 85de61e..18ad28b 100644
--- a/ref_dsp.c
+++ b/ref_dsp.c
@@ -23,8 +23,13 @@ THE SOFTWARE.
*/
+#if defined(__cplusplus)
+#include <cstdio>
+#include <cstdint>
+#else
#include <stdio.h>
#include <stdint.h>
+#endif
#ifdef __arm__
#include <armdsp.h>
diff --git a/ref_dspfns.c b/ref_dspfns.c
index 5680779..3e974ba 100644
--- a/ref_dspfns.c
+++ b/ref_dspfns.c
@@ -23,8 +23,13 @@ THE SOFTWARE.
*/
+#if defined(__cplusplus)
+#include <cstdio>
+#include <cstdint>
+#else
#include <stdio.h>
#include <stdint.h>
+#endif
#ifdef __arm__
#include <dspfns.h>
@@ -43,7 +48,7 @@ typedef int32_t func32_32_32_ptr(int32_t, int32_t);
typedef int16_t func16_32_ptr(int32_t);
typedef int32_t func32_32_16_16_ptr(int32_t, int16_t, int16_t);
-void test_16_fn_32(func16_32_ptr func, char* func_name,
+void test_16_fn_32(func16_32_ptr func, const char* func_name,
int init_Overflow, int init_Carry)
{
int32_t svar32_a;
@@ -88,7 +93,7 @@ void test_16_fn_32(func16_32_ptr func, char* func_name,
func_name, svar32_a, svar16_a, Overflow, Carry);
}
-void test_32_fn_32_32(func32_32_32_ptr func, char* func_name,
+void test_32_fn_32_32(func32_32_32_ptr func, const char* func_name,
int init_Overflow, int init_Carry)
{
int32_t svar32_a, svar32_b, svar32_c;
@@ -161,7 +166,7 @@ void test_32_fn_32_32(func32_32_32_ptr func, char* func_name,
func_name, svar32_a, svar32_b, svar32_c, Overflow, Carry);
}
-void test_32_fn_32_16_16(func32_32_16_16_ptr func, char* func_name,
+void test_32_fn_32_16_16(func32_32_16_16_ptr func, const char* func_name,
int init_Overflow, int init_Carry)
{
int32_t svar32_a, svar32_b;
diff --git a/ref_integer.c b/ref_integer.c
index 0b6151a..1e861ea 100644
--- a/ref_integer.c
+++ b/ref_integer.c
@@ -23,8 +23,13 @@ THE SOFTWARE.
*/
+#if defined(__cplusplus)
+#include <cstdio>
+#include <cstdint>
+#else
#include <stdio.h>
#include <stdint.h>
+#endif
#ifndef __arm__
#error Target not supported
diff --git a/ref_vaddhn.c b/ref_vaddhn.c
index 284396a..810e989 100644
--- a/ref_vaddhn.c
+++ b/ref_vaddhn.c
@@ -31,7 +31,11 @@ THE SOFTWARE.
#include "stm-arm-neon-ref.h"
+#if defined(__cplusplus)
+#include <cstdint>
+#else
#include <stdint.h>
+#endif
#ifndef INSN_NAME
#define INSN_NAME vaddhn
diff --git a/retarget.c b/retarget.c
index 7fb7fdf..3f01076 100644
--- a/retarget.c
+++ b/retarget.c
@@ -2,7 +2,11 @@
** Copyright (C) ARM Limited, 2005. All rights reserved.
*/
+#if defined(__cplusplus)
+#include <cstdio>
+#else
#include <stdio.h>
+#endif
#include <rt_misc.h>
// Heap base from scatter file
diff --git a/stm-arm-neon-ref.h b/stm-arm-neon-ref.h
index ae24127..22028dd 100644
--- a/stm-arm-neon-ref.h
+++ b/stm-arm-neon-ref.h
@@ -26,9 +26,15 @@ THE SOFTWARE.
#ifndef _STM_ARM_NEON_REF_H_
#define _STM_ARM_NEON_REF_H_
+#if defined(__cplusplus)
+#include <cstdio>
+#include <cinttypes>
+#include <cstring>
+#else
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
+#endif
#define xSTR(X) #X
#define STR(X) xSTR(X)
@@ -183,7 +189,7 @@ static void dump_results (char *test_name)
}
/* Dump results in hex (generic function) */
-static void dump_results_hex2 (char *test_name, char* comment)
+static void dump_results_hex2 (const char *test_name, const char* comment)
{
int i;
@@ -210,7 +216,7 @@ static void dump_results_hex2 (char *test_name, char* comment)
DUMP_FP(test_name, float, 32, 4, PRIx32);
}
-static void dump_results_hex (char *test_name)
+static void dump_results_hex (const char *test_name)
{
dump_results_hex2(test_name, "");
}
@@ -258,7 +264,7 @@ extern int errno;
#endif /* STM_ARM_NEON_MODELS */
-static void dump_neon_overflow(char* msg, char *name)
+static void dump_neon_overflow(const char* msg, const char *name)
{
fprintf(ref_file, "%s:%d:%s Neon overflow %d\n", msg, result_idx++,
name, Neon_Overflow);