home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWGENERIC_H__
- #define __RWGENERIC_H__
- pragma push_align_members(64);
-
- /*
- * Standardizes what various compilers see of the generic.h facility
- *
- * $Header: E:/vcs/rw/generic.h_v 1.0 11 Mar 1992 14:10:42 KEFFER $
- *
- ****************************************************************************
- *
- * Rogue Wave Software, Inc.
- * P.O. Box 2328
- * Corvallis, OR 97339
- *
- * Copyright (C) 1992. This software is subject to copyright
- * protection under the laws of the United States and other countries.
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/rw/generic.h_v $
- *
- * Rev 1.0 11 Mar 1992 14:10:42 KEFFER
- * Initial revision.
- */
- pragma push_align_members(64);
-
- #include "rw/defs.h"
-
- #ifdef __ZTC__
- # include <generic.hpp>
- #else
- # ifdef __GLOCK__
- # include <generic.hxx>
- # else
- # ifdef _MSC_VER /* Microsoft C/C++ ? */
- # define NO_NATIVE_GENERIC_H 1
- # else
- # include <generic.h>
- # endif
- # endif
- #endif
-
-
- #ifdef NO_NATIVE_GENERIC_H
-
- /*
- * If the compiler did not supply a generic.h, then we will have to
- * do so:
- *
- * Here is the functionality we need:
- *
- * MACROS:
- ** name2(one,Two) (we use the name2 macro directly)
- * result: oneTwo
- ** declare(Class,type)
- * result: Classdeclare(type)
- ** implement(Class,type)
- * result: Classimplement(type)
- ** callerror(Class,type,intarg,charsplatarg)
- * result: (*errorhandler(Class,type))(intarg,charsplatarg)
- ** set_handler(Class,type,handlerRetType)
- * result: set_typeClass_handler(handlerRetType)
- * errorhandler(Class,type)
- * result: typeClasshandler
- * Declarations and typedefs:
- * extern genericerror(int,char*)
- * typedef int(*GPT)(int,char)
- */
-
- extern genericerror(int,char*);
- typedef int (*GPT)(int,char*);
-
- #define name2(a,b) _rwname2(a,b) /* to force the args to be evaluated here */
- #define _rwname2(a,b) a##b
- #define name3(a,b,c) _rwname3(a,b,c)
- #define _rwname3(a,b,c) a##b##c
- #define name4(a,b,c,d) _rwname4(a,b,c,d)
- #define _rwname4(a,b,c,d) a##b##c##d
-
- #define declare(Class,type) name2(Class,declare)(type)
- #define implement(Class,type) name2(Class,implement)(type)
- #define callerror(Class,type,iarg,csarg) \
- (*errorhandler(Class,type))(iarg,csarg)
- #define set_handler(Class,type,hrt) name4(set_,type,Class,_handler)(hrt)
- #define errorhandler(Class,type) name3(type,Class,handler)
-
- #undef NO_NATIVE_GENERIC_H
-
- #endif /* NO_NATIVE_GENERIC_H */
-
- pragma pop_align_members();
- #endif /* __RWGENERIC_H__ */
-