Remove all references to the GC library, replacing GC_malloc
[fw/sdcc] / support / cpp / cpplib.c
index 06d7e71fa327d7a2b54c33fafe48c3c82b50400b..c395b83490df77e775e4fd84eab9f7d5b6153214 100644 (file)
@@ -22,8 +22,17 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  You are forbidden to forbid anyone else to use, share and improve
  what you give them.   Help stamp out software-hoarding!  */
 
+#if defined(_MSC_VER)
+
+#include "..\..\sdcc_vc.h"
+#include <io.h>
+
+#else
+
 #include "sdccconf.h"
 
+#endif
+
 #ifdef EMACS
 #define NO_SHORTNAMES
 #include "../src/config.h"
@@ -86,6 +95,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #else
 #ifndef VMS
 #ifndef USG
+#if !defined(_MSC_VER)
 #include <sys/time.h>          /* for __DATE__ and __TIME__ */
 #include <sys/resource.h>
 #else
@@ -93,6 +103,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 // #include <sys/times.h>
 #include <time.h>
 #include <fcntl.h>
+#endif  // _MSC_VER
 #endif /* USG */
 #endif /* not VMS */
 #endif
@@ -1024,7 +1035,7 @@ copy_rest_of_line (
          break;
        case '/':
          nextc = PEEKC();
-         if (nextc == '*' || (opts->cplusplus_comments && nextc == '*'))
+         if (nextc == '*' || (opts->cplusplus_comments && nextc == '/'))
            goto scan_directive_token;
          break;
        case '\f':
@@ -1397,6 +1408,11 @@ collect_expansion (
          concat = p;
 #endif
        }
+       else if (*p == '/') {
+           /* A c++ comment.  Discard to the end of line */
+           exp_p--;
+           p = limit;
+       }
        break;
       }
     }