mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 11:42:21 +00:00
Linux compilation of nsgmls (Matthew Howkins)
This commit is contained in:
parent
cc1d109aa9
commit
e60d58be07
17 changed files with 102 additions and 10 deletions
|
@ -58,8 +58,14 @@
|
|||
|
||||
#include "ConsoleOutput.h"
|
||||
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#include <fstream.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -285,8 +291,12 @@ Boolean CmdLineApp::openFilebufWrite(filebuf &file,
|
|||
if (fd < 0)
|
||||
return 0;
|
||||
return file.attach(fd) != 0;
|
||||
#else
|
||||
#if defined(linux)
|
||||
return file.open(filename, ios::out|ios::trunc) != 0;
|
||||
#else
|
||||
return file.open(filename, ios::out|ios::trunc|IOS_BINARY) != 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#if defined(linux)
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
#else
|
||||
class filebuf;
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -33,8 +33,12 @@
|
|||
#ifdef SP_SHORT_HEADERS
|
||||
#include <strstrea.h>
|
||||
#else
|
||||
#if defined(linux)
|
||||
#include <strstream>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
|
@ -78,7 +82,11 @@ String<char> OutputCodingSystem::convertOut(const StringC &str) const
|
|||
encoder->output(copy.data(), copy.size(), &stream);
|
||||
delete encoder;
|
||||
char *s = stream.str();
|
||||
#if defined(linux)
|
||||
String<char> result(s, stream.pcount());
|
||||
#else
|
||||
String<char> result(s, stream.out_waiting());
|
||||
#endif
|
||||
result += '\0';
|
||||
stream.freeze(0);
|
||||
#ifdef __lucid
|
||||
|
|
|
@ -41,7 +41,12 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(linux)
|
||||
#include <streambuf>
|
||||
using namespace std;
|
||||
#else
|
||||
class streambuf;
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -29,7 +29,11 @@
|
|||
#ifdef SP_MULTI_BYTE
|
||||
|
||||
#include "EUCJPCodingSystem.h"
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
#include "Fixed2CodingSystem.h"
|
||||
#include "macros.h"
|
||||
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -26,7 +26,11 @@
|
|||
|
||||
#include "splib.h"
|
||||
#include "IdentityCodingSystem.h"
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
|
|
|
@ -91,9 +91,12 @@ CXXOPTIONS = \
|
|||
/*
|
||||
* Flags passed into compile step when doing manual template instantiation.
|
||||
*/
|
||||
CXXTEMPLATEFLAGS = -ptf
|
||||
CXXTEMPLATEFLAGS =
|
||||
|
||||
M4 = /usr/bin/m4
|
||||
|
||||
CXXEXTRA_DEFINES = -fpermissive
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(RsArchitecture)
|
||||
|
|
|
@ -28,7 +28,11 @@
|
|||
#include "OutputCharStream.h"
|
||||
#include "CodingSystem.h"
|
||||
#include "macros.h"
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
|
@ -144,7 +148,11 @@ void IosOutputCharStream::flush()
|
|||
encoder_->output(buf_, ptr_ - buf_, byteStream_);
|
||||
ptr_ = buf_;
|
||||
}
|
||||
#if defined(linux)
|
||||
byteStream_->pubsync();
|
||||
#else
|
||||
byteStream_->sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
void IosOutputCharStream::flushBuf(Char c)
|
||||
|
|
|
@ -33,7 +33,12 @@
|
|||
#include "Owner.h"
|
||||
#include "CodingSystem.h"
|
||||
|
||||
#if defined(linux)
|
||||
#include <streambuf>
|
||||
using namespace std;
|
||||
#else
|
||||
class streambuf;
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -34,15 +34,15 @@ namespace SP_NAMESPACE {
|
|||
template<class T, class K, class HF, class KF>
|
||||
OwnerTable<T, K, HF, KF>::~OwnerTable()
|
||||
{
|
||||
for (size_t i = 0; i < vec_.size(); i++)
|
||||
delete vec_[i];
|
||||
for (size_t i = 0; i < this->vec_.size(); i++)
|
||||
delete this->vec_[i];
|
||||
}
|
||||
|
||||
template<class T, class K, class HF, class KF>
|
||||
void OwnerTable<T, K, HF, KF>::clear()
|
||||
{
|
||||
for (size_t i = 0; i < vec_.size(); i++)
|
||||
delete vec_[i];
|
||||
for (size_t i = 0; i < this->vec_.size(); i++)
|
||||
delete this->vec_[i];
|
||||
PointerTable<T *, K, HF, KF>::clear();
|
||||
}
|
||||
|
||||
|
@ -50,12 +50,12 @@ template<class T, class K, class HF, class KF>
|
|||
void
|
||||
CopyOwnerTable<T, K, HF, KF>::operator=(const CopyOwnerTable<T, K, HF, KF> &t)
|
||||
{
|
||||
clear();
|
||||
this->clear();
|
||||
//PointerTable<T *, K, HF, KF>::operator=(t);
|
||||
// FIXME This isn't exception safe.
|
||||
for (size_t i = 0; i < vec_.size(); i++)
|
||||
if (vec_[i])
|
||||
vec_[i] = vec_[i]->copy();
|
||||
for (size_t i = 0; i < this->vec_.size(); i++)
|
||||
if (this->vec_[i])
|
||||
this->vec_[i] = this->vec_[i]->copy();
|
||||
}
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
|
|
|
@ -29,7 +29,12 @@
|
|||
#ifdef SP_MULTI_BYTE
|
||||
|
||||
#include "SJISCodingSystem.h"
|
||||
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -30,7 +30,11 @@
|
|||
|
||||
#include "UTF8CodingSystem.h"
|
||||
#include "constant.h"
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -39,7 +39,11 @@ extern "C" {
|
|||
void *memmove(void *, const void *, size_t);
|
||||
}
|
||||
#endif
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
|
|
|
@ -32,9 +32,11 @@
|
|||
|
||||
#ifdef __GNUG__
|
||||
// It's not missing, but it pulls in libg++
|
||||
#if !defined(linux)
|
||||
#define SP_NEW_H_MISSING
|
||||
// set_new_handler() has to be declared extern "C"
|
||||
#define SP_SET_NEW_HANDLER_EXTERN_C
|
||||
#endif
|
||||
#ifndef SP_MANUAL_INST
|
||||
#define SP_MANUAL_INST
|
||||
#endif
|
||||
|
|
|
@ -38,8 +38,13 @@
|
|||
#include "sptchar.h"
|
||||
#include "macros.h"
|
||||
|
||||
#if defined(linux)
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#include <fstream.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
@ -79,13 +84,21 @@ public:
|
|||
const AppChar *filename,
|
||||
const StringC &filenameStr,
|
||||
const OutputCodingSystem *,
|
||||
#if defined(linux)
|
||||
::Messenger *messenger);
|
||||
#else
|
||||
Messenger *messenger);
|
||||
#endif
|
||||
~XRastEventHandler();
|
||||
void message(MessageEvent *);
|
||||
void truncateOutput();
|
||||
void allLinkTypesActivated();
|
||||
private:
|
||||
#if defined(linux)
|
||||
::Messenger *messenger_;
|
||||
#else
|
||||
Messenger *messenger_;
|
||||
#endif
|
||||
// file_ must come before os_ so it gets inited first
|
||||
filebuf file_;
|
||||
IosOutputCharStream os_;
|
||||
|
@ -235,7 +248,11 @@ XRastEventHandler::XRastEventHandler(SgmlParser *parser,
|
|||
const AppChar *filename,
|
||||
const StringC &filenameStr,
|
||||
const OutputCodingSystem *codingSystem,
|
||||
Messenger *messenger)
|
||||
#if defined(linux)
|
||||
::Messenger *messenger)
|
||||
#else
|
||||
::Messenger *messenger)
|
||||
#endif
|
||||
: RastEventHandler(parser, messenger),
|
||||
messenger_(messenger),
|
||||
filename_(filename),
|
||||
|
|
|
@ -39,7 +39,11 @@ void set_new_handler(VFP);
|
|||
|
||||
#else /* not SP_NEW_H_MISSING */
|
||||
|
||||
#if defined(linux)
|
||||
#include <new>
|
||||
#else
|
||||
#include <new.h>
|
||||
#endif
|
||||
|
||||
#endif /* not SP_NEW_H_MISSING */
|
||||
|
||||
|
|
Loading…
Reference in a new issue