home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!news.claremont.edu!ucivax!news.service.uci.edu!usc!sdd.hp.com!news.cs.indiana.edu!umn.edu!AHPCRC.umn.edu!felix
- From: felix@AHPCRC.umn.edu (Paul Felix)
- Subject: Re: X programs in C++, why do they need -DFUNCPROTO ?
- Message-ID: <1992Sep4.161053.369@news2.cis.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: pi32.arc.umn.edu
- Organization: AHPCRC
- References: <2921@contex.contex.com> <1992Sep4.073425.12442@cv.ruu.nl>
- Date: Fri, 4 Sep 1992 16:10:53 GMT
- Lines: 69
-
- In article <1992Sep4.073425.12442@cv.ruu.nl>, rvloon@cv.ruu.nl (Ronald van Loon) writes:
- |> In <2921@contex.contex.com> avinash@felix.contex.com (Avinash Chopde) writes:
- |>
- |> |"I had to provide a -DFUNCPROTO option to the C++ compiler (2.11 and 3.10)
- |> |"to compile a X program.
- |> |"Without -DFUNCPROTO, the prototypes for XtInitialize(..), etc are not
- |> |"included.
- |> |"
- |> |"Now, is this normal behavior, or is there some other procedure
- |> |"to compile C++ X programs ?
- |> |"Thanks for any help....
- |>
- |> FUNCPROTO is a symbol that when defined will force the prototypes to be used.
- |>
- |> Or, more correctly, that will cause the symbol NeedFunctionPrototypes to be
- |> set to a value greater than zero. Normally this symbol, when not defined
- |> manually, will be defined when either __STDC__, __cplusplus, c_plusplus, or
- |> FUNCPROTO are defined. FUNCPROTO may be a special case in X11R5, it not only
- |> needs to be defined, it also needs to be defined to a value > 0 for prototypes
- |> to be used.
- |>
- |> In short, if you want to be sure that Prototypes are used, then define
- |> NeedFunctionPrototypes to '1'. This should work on all systems, while
- |> FUNCPROTO might not (other systems use XTFUNCPROTO, for example).
- |> --
- |> Ronald van Loon (rvloon@cv.ruu.nl) 3DCV Group, Utrecht, The Netherlands.
- |>
- |> "I believe the word you are looking for is "AAAAAAAAAARRRRRRRRRRGGGGGHHHH!"
- |> - The Penguin (Batman ][)
-
- I'm afraid you still have to define FUNCPROTO on the SGI. Take a look at
- the top part of /usr/include/X11/Intrinsic.h:
-
- #ifdef FUNCPROTO
- #undef NeedFunctionPrototypes
- #define NeedFunctionPrototypes 1
- #ifdef sgi
- #undef NeedWidePrototypes
- #define NeedWidePrototypes 0
- #endif /* sgi */
- #else
- #undef NeedFunctionPrototypes
- #define NeedFunctionPrototypes 0
- #undef NeedWidePrototypes
- #define NeedWidePrototypes 0
- #endif
-
- #ifndef NeedFunctionPrototypes
- #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
- #define NeedFunctionPrototypes 1
- #else
- #define NeedFunctionPrototypes 0
- #endif /* __STDC__ */
- #endif /* NeedFunctionPrototypes */
-
- If you look at this closely, you'll see that FUNCPROTO must be defined.
- But, if you use imake on the SGI with the config files in /usr/lib/X11/config,
- both macros NeedFunctionPrototypes and FUNCPROTO should get set properly.
-
- --
-
- Paul
- ________________________________________________________________________
-
- Paul Felix felix@ahpcrc.umn.edu
- AHPCRC/University of Minnesota (612) 626-8084
- 1100 Washington Ave. So.
- Minneapolis, MN 55415
- ________________________________________________________________________
-