Ignore:
Timestamp:
2000-06-12T14:49:06+12:00 (24 years ago)
Author:
sjboddie
Message:

Made a few minor changes to get the local library compiling under VC++ 6.0
using the built-in STL (i.e. without the GSDL_USE_IOS_H pre-processor
definition set).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/cgiwrapper.cpp

    r1193 r1203  
     1#include "text_t.h"
     2
    13#include <windows.h>
    24#include <string.h>
     
    7779  RequestInfoT *RInfo;
    7880  ostream *casostr;
     81#if !defined (GSDL_USE_IOS_H)
     82  char buffer[256];
     83#endif
    7984};
    8085
    8186textstreambuf::textstreambuf() {
    8287  tsbreset();
     88#if !defined (GSDL_USE_IOS_H)
     89  setp (&buffer[0], &buffer[255]);
     90#else
    8391  if (base() == ebuf()) allocate();
    8492  setp (base(), ebuf());
     93#endif
    8594};
    8695
    8796int textstreambuf::sync () {
    8897  if ((RInfo != NULL) &&
    89       (Send_String_N(pbase(), out_waiting(), RInfo) < 0)) {
     98      (Send_String_N(pbase(), pptr()-pbase(), RInfo) < 0)) {
    9099    RInfo = NULL;
    91100  }
     
    93102  if (casostr != NULL) {
    94103    char *thepbase=pbase();
    95         for (int i=0;i<out_waiting();i++) (*casostr).put(thepbase[i]);
     104    for (int i=0;i<(pptr()-pbase());i++) (*casostr).put(thepbase[i]);
    96105  }
    97106 
     
    117126  int overflow (int ch);
    118127  int underflow () {return EOF;}
     128
     129#if !defined (GSDL_USE_IOS_H)
     130private:
     131  char buffer[256];
     132#endif
    119133};
    120134
    121135logstreambuf::logstreambuf () {
     136#if !defined (GSDL_USE_IOS_H)
     137  setp (&buffer[0], &buffer[255]);
     138#else
    122139  if (base() == ebuf()) allocate();
    123140  setp (base(), ebuf());
     141#endif
    124142}
    125143
     
    127145  if (gsdl_keep_log || gsdl_show_console) {
    128146    log_message ("LOCAL LIB MESSAGE: ");
    129         log_message_N (pbase(), out_waiting());
     147        log_message_N (pbase(), pptr()-pbase());
    130148  }
    131149
     
    304322// returns 1 if successful, 0 if unsuccessful
    305323int gsdl_init () {
    306   cerr = &logstream;
    307   cout = &textstream;
     324  cerr.rdbuf(&logstream);
     325  cout.rdbuf(&textstream);
    308326
    309327  // collection should be set to "" unless in
Note: See TracChangeset for help on using the changeset viewer.