diff options
author | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2003-06-17 09:28:06 +0000 |
---|---|---|
committer | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2003-06-17 09:28:06 +0000 |
commit | 3d986cc1591a8eb5646f2c5cd4045609aa69df21 (patch) | |
tree | 56ca97012f7d6501967adc4d8e838448713999ae | |
parent | 077ee51b636cb8d9a8de34f035c489f1478f1ad0 (diff) |
Fixed code compilation without HDF4 support.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@35 21a6bef8-4479-4f54-8f8d-0db94a2919ef
-rw-r--r-- | src/ioconvert.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/ioconvert.cc b/src/ioconvert.cc index 6ba466c..5c818b7 100644 --- a/src/ioconvert.cc +++ b/src/ioconvert.cc @@ -41,39 +41,53 @@ int main(int argc,char *argv[]){ else swap=0; // for the input file +#if defined(WITH_HDF4) || defined(WITH_HDF5) char *s_ext=strrchr(argv[sindex],'.'); char *d_ext=strrchr(argv[dindex],'.'); +#endif #ifdef WITH_HDF4 - if(s_ext && !strcmp(s_ext,".hdf")){ + if(s_ext && !strcmp(s_ext,".hdf")) + { infile=hdffile=new HDFIO(argv[sindex],IObase::Read); hdfin=1; } + else #endif #ifdef WITH_HDF5 - else if(s_ext && !strcmp(s_ext,".h5")){ + if(s_ext && !strcmp(s_ext,".h5")) + { infile=new H5IO(argv[sindex],IObase::Read); } + else #endif - else // assume its raw + { + // assume its raw infile=new IEEEIO(argv[sindex],IObase::Read); + } if(!infile->isValid()){ printf("cant read %s\n",argv[sindex]); usage(); } // for the outfile, +#ifdef WITH_HDF4 if(d_ext && !strcmp(d_ext,".hdf")) { outfile=new HDFIO(argv[dindex],IObase::Create); } + else +#endif #ifdef WITH_HDF5 - else if(d_ext && !strcmp(d_ext,".h5")) + if(d_ext && !strcmp(d_ext,".h5")) { outfile=new H5IO(argv[dindex],IObase::Create); } + else #endif - else // assume its raw + { + // assume its raw outfile=new IEEEIO(argv[dindex],IObase::Create,swap); // swap only affects IEEEIO output + } if(!outfile->isValid()){ printf("cant write %s\n",argv[dindex]); delete infile; |