From 1db4cc25966c432525ce99e15a41c81db43854df Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 31 Jan 2005 23:13:42 -0500 Subject: [svn-r9905] Purpose: fix bugs. Description: The three variables, g_nTasks, outBuff, and outBuffOffset, were declared in ph5diff.h. That means they are declared in various *.c files that include it, thus having the appearance of multiple defined. Most C compilers are forgiving of this error but the g++ rejects this practice. Solution: Make it only an extern declaration in ph5diff.h but really defined them in h5diff_util.c Platforms tested: sleipnir using g++ since this only failed in Daily test. Also testes in heping, serial and parallel modes. --- tools/lib/h5diff_util.c | 4 ++++ tools/lib/ph5diff.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index fe2e73c..d4b6437 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -16,6 +16,10 @@ #include "ph5diff.h" #include "H5private.h" +/* global variables */ +int g_nTasks; +char outBuff[OUTBUFF_SIZE]; +unsigned int outBuffOffset; /*------------------------------------------------------------------------- * Function: parallel_print diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 636e4c0..320b39a 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -30,9 +30,9 @@ #define MPI_TAG_END 6 #define MPI_TAG_PARALLEL 7 -int g_nTasks; -char outBuff[OUTBUFF_SIZE]; -unsigned int outBuffOffset; +extern int g_nTasks; +extern char outBuff[OUTBUFF_SIZE]; +extern unsigned int outBuffOffset; struct diff_args { -- cgit v0.12