See patch.
>From d6d86e42f39b750f965608e359b9d05efc1c7732 Mon Sep 17 00:00:00 2001
From: Pascal Stumpf <pascal.stu...@cubes.de>
Date: Sat, 11 Aug 2012 14:09:40 +0200
Subject: [PATCH] Make nsgmls compile on OpenBSD.
As far as I can tell, the duplicate instantiations from entmgr_inst.m4 are
unnecessary and only cause compile failures without -fpermissive.
---
cde/programs/nsgmls/CmdLineApp.C | 4 ++--
cde/programs/nsgmls/CmdLineApp.h | 2 +-
cde/programs/nsgmls/CodingSystem.C | 4 ++--
cde/programs/nsgmls/CodingSystem.h | 2 +-
cde/programs/nsgmls/OutputCharStream.C | 4 ++--
cde/programs/nsgmls/OutputCharStream.h | 2 +-
cde/programs/nsgmls/config.h | 2 +-
cde/programs/nsgmls/entmgr_inst.m4 | 6 ------
cde/programs/nsgmls/nsgmls.C | 8 ++++----
cde/programs/nsgmls/xnew.h | 2 +-
10 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/cde/programs/nsgmls/CmdLineApp.C b/cde/programs/nsgmls/CmdLineApp.C
index b2f7468..4ba7cbc 100644
--- a/cde/programs/nsgmls/CmdLineApp.C
+++ b/cde/programs/nsgmls/CmdLineApp.C
@@ -58,7 +58,7 @@
#include "ConsoleOutput.h"
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <iostream>
#include <fstream>
using namespace std;
@@ -292,7 +292,7 @@ Boolean CmdLineApp::openFilebufWrite(filebuf &file,
return 0;
return file.attach(fd) != 0;
#else
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
return file.open(filename, ios::out|ios::trunc) != 0;
#else
return file.open(filename, ios::out|ios::trunc|IOS_BINARY) != 0;
diff --git a/cde/programs/nsgmls/CmdLineApp.h b/cde/programs/nsgmls/CmdLineApp.h
index 98f5773..45d505f 100644
--- a/cde/programs/nsgmls/CmdLineApp.h
+++ b/cde/programs/nsgmls/CmdLineApp.h
@@ -43,7 +43,7 @@
#include <stddef.h>
#endif
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <fstream>
using namespace std;
#else
diff --git a/cde/programs/nsgmls/CodingSystem.C
b/cde/programs/nsgmls/CodingSystem.C
index ad7935a..6f9e520 100644
--- a/cde/programs/nsgmls/CodingSystem.C
+++ b/cde/programs/nsgmls/CodingSystem.C
@@ -33,7 +33,7 @@
#ifdef SP_SHORT_HEADERS
#include <strstrea.h>
#else
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <strstream>
#else
#include <strstream.h>
@@ -82,7 +82,7 @@ String<char> OutputCodingSystem::convertOut(const StringC
&str) const
encoder->output(copy.data(), copy.size(), &stream);
delete encoder;
char *s = stream.str();
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
String<char> result(s, stream.pcount());
#else
String<char> result(s, stream.out_waiting());
diff --git a/cde/programs/nsgmls/CodingSystem.h
b/cde/programs/nsgmls/CodingSystem.h
index e073ae5..62adbd0 100644
--- a/cde/programs/nsgmls/CodingSystem.h
+++ b/cde/programs/nsgmls/CodingSystem.h
@@ -41,7 +41,7 @@
#include <stddef.h>
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <streambuf>
using namespace std;
#else
diff --git a/cde/programs/nsgmls/OutputCharStream.C
b/cde/programs/nsgmls/OutputCharStream.C
index fd1f758..1739437 100644
--- a/cde/programs/nsgmls/OutputCharStream.C
+++ b/cde/programs/nsgmls/OutputCharStream.C
@@ -28,7 +28,7 @@
#include "OutputCharStream.h"
#include "CodingSystem.h"
#include "macros.h"
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <iostream>
#else
#include <iostream.h>
@@ -148,7 +148,7 @@ void IosOutputCharStream::flush()
encoder_->output(buf_, ptr_ - buf_, byteStream_);
ptr_ = buf_;
}
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
byteStream_->pubsync();
#else
byteStream_->sync();
diff --git a/cde/programs/nsgmls/OutputCharStream.h
b/cde/programs/nsgmls/OutputCharStream.h
index 15088bb..7551bfd 100644
--- a/cde/programs/nsgmls/OutputCharStream.h
+++ b/cde/programs/nsgmls/OutputCharStream.h
@@ -33,7 +33,7 @@
#include "Owner.h"
#include "CodingSystem.h"
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <streambuf>
using namespace std;
#else
diff --git a/cde/programs/nsgmls/config.h b/cde/programs/nsgmls/config.h
index 7859a9c..2f7bcc9 100644
--- a/cde/programs/nsgmls/config.h
+++ b/cde/programs/nsgmls/config.h
@@ -32,7 +32,7 @@
#ifdef __GNUG__
// It's not missing, but it pulls in libg++
-#if !defined(linux)
+#if !defined(linux) && !defined(CSRG_BASED)
#define SP_NEW_H_MISSING
// set_new_handler() has to be declared extern "C"
#define SP_SET_NEW_HANDLER_EXTERN_C
diff --git a/cde/programs/nsgmls/entmgr_inst.m4
b/cde/programs/nsgmls/entmgr_inst.m4
index 79a9784..20002a8 100644
--- a/cde/programs/nsgmls/entmgr_inst.m4
+++ b/cde/programs/nsgmls/entmgr_inst.m4
@@ -61,7 +61,6 @@ __instantiate(`RangeMapIter<WideChar,UnivChar>')
__instantiate(`RangeMap<WideChar,UnivChar>')
__instantiate(Vector<InputSourceOriginNamedCharRef>)
__instantiate(Vector<StringC>)
-__instantiate(Vector<String<EquivCode> >)
__instantiate(Owner<ExternalInfo>)
__instantiate(ISet<Char>)
__instantiate(Vector<ISetRange<Char> >)
@@ -71,16 +70,11 @@ __instantiate(ISetIter<WideChar>)
__instantiate(Vector<ISetRange<WideChar> >)
__instantiate(SubstTable<Char>)
__instantiate(SharedXcharMap<PackedBoolean>)
-__instantiate(SharedXcharMap<unsigned char>)
__instantiate(SharedXcharMap<EquivCode>)
-__instantiate(String<EquivCode>)
__instantiate(String<SyntaxChar>)
__instantiate(XcharMap<PackedBoolean>)
-__instantiate(XcharMap<unsigned char>)
__instantiate(XcharMap<EquivCode>)
__instantiate(Vector<char>)
-__instantiate(Vector<PackedBoolean>)
-__instantiate(SubstTable<Char>)
#ifdef SP_NAMESPACE
}
diff --git a/cde/programs/nsgmls/nsgmls.C b/cde/programs/nsgmls/nsgmls.C
index c1ec860..f9490f2 100644
--- a/cde/programs/nsgmls/nsgmls.C
+++ b/cde/programs/nsgmls/nsgmls.C
@@ -38,7 +38,7 @@
#include "sptchar.h"
#include "macros.h"
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <iostream>
#include <fstream>
#else
@@ -84,7 +84,7 @@ public:
const AppChar *filename,
const StringC &filenameStr,
const OutputCodingSystem *,
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
::Messenger *messenger);
#else
Messenger *messenger);
@@ -94,7 +94,7 @@ public:
void truncateOutput();
void allLinkTypesActivated();
private:
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
::Messenger *messenger_;
#else
Messenger *messenger_;
@@ -248,7 +248,7 @@ XRastEventHandler::XRastEventHandler(SgmlParser *parser,
const AppChar *filename,
const StringC &filenameStr,
const OutputCodingSystem *codingSystem,
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
::Messenger *messenger)
#else
::Messenger *messenger)
diff --git a/cde/programs/nsgmls/xnew.h b/cde/programs/nsgmls/xnew.h
index caffae6..9659639 100644
--- a/cde/programs/nsgmls/xnew.h
+++ b/cde/programs/nsgmls/xnew.h
@@ -39,7 +39,7 @@ void set_new_handler(VFP);
#else /* not SP_NEW_H_MISSING */
-#if defined(linux)
+#if defined(linux) || defined(CSRG_BASED)
#include <new>
#else
#include <new.h>
--
1.7.6
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel