home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / 20881 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.5 KB  |  85 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!utzoo!censor!animal!base!enterprise!saw
  3. From: saw@enterprise (Siegurd Weber)
  4. Subject: C++ patch for makedepend
  5. Message-ID: <1993Jan7.161531.16900@base>
  6. Summary: patch to recognize // comments in makedepend
  7. Keywords: C++ comments, makedepend
  8. Sender: usenet@base (USENET News System)
  9. Nntp-Posting-Host: enterprise
  10. Organization: Bell Canada Operations Development
  11. X-Newsreader: Tin 1.1 PL5
  12. Date: Thu, 7 Jan 1993 16:15:31 GMT
  13. Lines: 70
  14.  
  15. Hi Folks, 
  16.   If you are using C++ and makedepend, I hope to spare you from
  17. a potentially hideous experience with this posting.
  18.  
  19.   Makedepend, or at least our version that came
  20. with X11R5 does not recognize C++ style comments.
  21. Since we had a line of the form 
  22.  
  23. //***************************************************
  24.  
  25. as part of our standard header, makedepend gobbled up
  26. the rest of the file in search for the terminating */.
  27.  
  28. The following patch will add the recognition of 
  29. C++ style comments to makedepend.
  30.  
  31. If you would rather not change your makedepend, simply
  32. make sure that you do not have any //* in your source.
  33.  
  34. Enjoy,
  35.    Sieg
  36.  
  37. PS. Thanks to Todd Brunhoff the original author of makedepend for 
  38.     this great utility program.
  39.  
  40.  
  41. *** main.c    Thu Jan  7 10:05:00 1993
  42. --- ../main.c    Wed Jan  6 16:06:39 1993
  43. ***************
  44. *** 398,403 ****
  45. --- 398,421 ----
  46.               }
  47.               continue;
  48.           }
  49. +         /* case to consume C++ style comments starting with //.
  50. +          * "//" comments will cause a problem if they contain /*
  51. +        * in which case makedepend sets the rest of the file 
  52. +        * to white space.
  53. +        */
  54. +         else if (*p == '/' && *(p+1) == '/') {                            
  55. +             *p++ = ' ', *p++ = ' ';
  56. +             while (*p) {
  57. +                 if (*p == '\n'){
  58. +                   *p = ' ';
  59. +                   lineno++;
  60. +                   break;
  61. +                 }
  62. +                 *p++ = ' ';
  63. +             }
  64. +             continue;
  65. +         }
  66.           else if (*p == '\n') {
  67.               lineno++;
  68.               if (*bol == '#') {
  69.  
  70.  
  71. --
  72. ************************************************************
  73. * ******************************************************** *
  74. * * Sieg Weber - Teso International                      * *
  75. * * 1617 Digby St.                                       * *
  76. * * Ottawa, ONT.  K1G 0P5                                * *
  77. * * 1617 Digby St.                                       * *
  78. * * (613) 731 3163                saw@stam.qe.bell.ca    * *
  79. * * Consultant (OOA, OOD, C++, X, Motif, Un*x)           * *
  80. * ******************************************************** *
  81. ************************************************************
  82.  
  83.  
  84.