This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

SunOS 5.6 / gcc 2.95 problem


Hi again,

I'm getting this error when I have the 'triplet' code uncommented
in the attached .h file on SunOS 5.6

In file included from fileconf.cpp:34:
/home/prez/Magick-2.0-a1/include/utils.h:71: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:72: `operator ==(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:72: `operator ==(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:77: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:78: `operator !=(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:78: `operator !=(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:83: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:84: `operator <(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:84: `operator <(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:91: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:92: `operator >(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:92: `operator >(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:97: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:98: `operator <=(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:98: `operator <=(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:103: parse error before 00000080'
/home/prez/Magick-2.0-a1/include/utils.h:104: `operator >=(...)' must have an argument of class or enumerated type
/home/prez/Magick-2.0-a1/include/utils.h:104: `operator >=(...)' must take exactly two arguments
/home/prez/Magick-2.0-a1/include/utils.h:109: parse error before 00000080'
make[1]: *** [fileconf.o] Error 1

Care to shed any light on it?  The code compiled fine under linux
and windows, and it looks syntaxically correct.

_O_ PreZ :)                           Finger prez@srealm.net.au _O_
 |  prez@goth.net                      for full PGP Public Key   | 

PGP FingerPrint: B3 0C F3 32 DE 5A 7D 90  26 F6 FA 38 CC 0A 2D D8
Goth Code '98:   tSKeba5qaSabsaaaGbaa75KAASWGuajmsvbieqcL4BaaLb3F4
                 nId5mefqmDjmmgm#haxthgzpj4GiysNkycSRGHabiabOkauNSW
Magick Code .92: MWI S W++ N+ PCE/NA++ D A a+ C G QO+ 666 Y      
// $Id: utils.h,v 1.13 1999/08/06 00:20:41 prez Exp $
//
// Magick IRC Services
// (c) 1997-1999 Preston A. Elder <prez@magick.tm>
// (c) 1998-1999 W. King <ungod@magick.tm>
//
// The above copywright may not be removed under any
// circumstances, however it may be added to if any
// modifications are made to this file.  All modified
// code must be clearly documented and labelled.
//
// ===================================================
#ifndef _UTILS_H
#define _UTILS_H

#include "mstring.h"

const char FILE_SEP_EXT = '.';
const char FILE_SEP_DSK = ':';
const char FILE_SEP_PATH_DOS = '\\';
const char FILE_SEP_PATH_UNIX = '/';

extern void wxSplitPath(const char *pszFileName,
                             mstring *pstrPath,
                             mstring *pstrName,
                             mstring *pstrExt);

extern mstring &wxGetHomeDir(mstring &pstr);

extern bool wxIsAbsolutePath (const mstring& filename);

// Generate a unique ID
extern long wxNewId(void);
#define NewId wxNewId

// Ensure subsequent IDs don't clash with this one
extern void wxRegisterId(long id);
#define RegisterId wxRegisterId

// Return the current ID
extern long wxGetCurrentId(void);

// Get current working directory.
// If buf is NULL, allocates space using new, else
// copies into buf.
// IMPORTANT NOTE getcwd is know not to work under some releases
// of Win32s 1.3, according to MS release notes!
char* wxGetWorkingDirectory(char *buf = (char *) NULL,int sz = 1000);
// new and preferred version of wxGetWorkingDirectory
// NB: can't have the same name because of overloading ambiguity
mstring wxGetCwd();

// extrapolated from the ms's pair<T1,T2> template code

template<class _T1, class _T2, class _T3> class triplet 
{
public:
    typedef _T1 first_type;
    typedef _T2 second_type;
    typedef _T3 third_type;
    triplet() 
	: first(_T1()), second(_T2()), third(_T3()) {}
    triplet(const _T1& _V1, const _T2& _V2, const _T3& _V3)
	: first(_V1), second(_V2), third(_V3) {}
    _T1 first;
    _T2 second;
    _T3 third;
};

template<class _T1, class _T2, class _T3> inline
bool operator==(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return (_X.first==_Y.first && _X.second==_Y.second && _X.third == _Y.third);
}
    
template<class _T1, class _T2, class _T3> inline
bool operator!=(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return (!(_X==_Y));
}

template<class _T1, class _T2, class _T3> inline
bool operator<(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return (_X.first<_Y.first
	|| (!(_X.first<_Y.first) && (_X.second<_Y.second))
	|| (!(_X.first<_Y.first) && (!(_X.second<_Y.second) && (_X.third<_Y.third))));
}

template<class _T1, class _T2, class _T3> inline
bool operator>(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return (_Y < _X);
}

template<class _T1, class _T2, class _T3> inline
bool operator<=(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return !(_Y < _X);
}

template<class _T1, class _T2, class _T3> inline
bool operator>=(const triplet<_T1, _T2, _T3>& _X, const triplet<_T1, _T2, _T3>& _Y)
{
    return !(_X < _Y);
}

template<class _T1, class _T2, class _T3> inline
triplet<_T1,_T2,_T3> make_triplet(const _T1& _X, const _T2& _Y, const _T3& _Z)
{
    return (triplet<_T1,_T2,_T3>(_X,_Y,_Z));
}

#endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]