home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13291 < prev    next >
Encoding:
Text File  |  1992-09-04  |  3.2 KB  |  82 lines

  1. Newsgroups: comp.sys.sgi
  2. 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
  3. From: felix@AHPCRC.umn.edu (Paul Felix)
  4. Subject: Re: X programs in C++, why do they need -DFUNCPROTO ?
  5. Message-ID: <1992Sep4.161053.369@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: pi32.arc.umn.edu
  8. Organization: AHPCRC
  9. References: <2921@contex.contex.com> <1992Sep4.073425.12442@cv.ruu.nl>
  10. Date: Fri, 4 Sep 1992 16:10:53 GMT
  11. Lines: 69
  12.  
  13. In article <1992Sep4.073425.12442@cv.ruu.nl>, rvloon@cv.ruu.nl (Ronald van Loon) writes:
  14. |> In <2921@contex.contex.com> avinash@felix.contex.com (Avinash Chopde) writes:
  15. |> 
  16. |> |"I had to provide a -DFUNCPROTO option to the C++ compiler (2.11 and 3.10)
  17. |> |"to compile a X program.
  18. |> |"Without -DFUNCPROTO, the prototypes for XtInitialize(..), etc are not
  19. |> |"included.
  20. |> |"
  21. |> |"Now, is this normal behavior, or is there some other procedure
  22. |> |"to compile C++ X programs ?
  23. |> |"Thanks for any help....
  24. |> 
  25. |> FUNCPROTO is a symbol that when defined will force the prototypes to be used.
  26. |> 
  27. |> Or, more correctly, that will cause the symbol NeedFunctionPrototypes to be
  28. |> set to a value greater than zero. Normally this symbol, when not defined
  29. |> manually, will be defined when either __STDC__, __cplusplus, c_plusplus, or
  30. |> FUNCPROTO are defined. FUNCPROTO may be a special case in X11R5, it not only
  31. |> needs to be defined, it also needs to be defined to a value > 0 for prototypes
  32. |> to be used. 
  33. |> 
  34. |> In short, if you want to be sure that Prototypes are used, then define
  35. |> NeedFunctionPrototypes to '1'. This should work on all systems, while
  36. |> FUNCPROTO might not (other systems use XTFUNCPROTO, for example).
  37. |> -- 
  38. |> Ronald van Loon (rvloon@cv.ruu.nl) 3DCV Group, Utrecht, The Netherlands.
  39. |> 
  40. |> "I believe the word you are looking for is "AAAAAAAAAARRRRRRRRRRGGGGGHHHH!"
  41. |>     - The Penguin (Batman ][)
  42.  
  43. I'm afraid you still have to define FUNCPROTO on the SGI. Take a look at
  44. the top part of /usr/include/X11/Intrinsic.h:
  45.  
  46. #ifdef FUNCPROTO
  47. #undef NeedFunctionPrototypes
  48. #define NeedFunctionPrototypes 1
  49. #ifdef sgi
  50. #undef NeedWidePrototypes
  51. #define NeedWidePrototypes 0
  52. #endif /* sgi */
  53. #else
  54. #undef NeedFunctionPrototypes
  55. #define NeedFunctionPrototypes 0
  56. #undef NeedWidePrototypes
  57. #define NeedWidePrototypes 0
  58. #endif
  59.  
  60. #ifndef NeedFunctionPrototypes
  61. #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
  62. #define NeedFunctionPrototypes 1
  63. #else
  64. #define NeedFunctionPrototypes 0
  65. #endif /* __STDC__ */
  66. #endif /* NeedFunctionPrototypes */
  67.  
  68. If you look at this closely, you'll see that FUNCPROTO must be defined.
  69. But, if you use imake on the SGI with the config files in /usr/lib/X11/config,
  70. both macros NeedFunctionPrototypes and FUNCPROTO should get set properly.
  71.  
  72. -- 
  73.  
  74. Paul
  75. ________________________________________________________________________
  76.                                                                            
  77.  Paul Felix                                        felix@ahpcrc.umn.edu
  78.  AHPCRC/University of Minnesota                    (612) 626-8084
  79.  1100 Washington Ave. So.
  80.  Minneapolis, MN 55415
  81. ________________________________________________________________________
  82.