]> git.draconx.ca Git - gob-dx.git/blobdiff - src/out.c
Release 0.91.1
[gob-dx.git] / src / out.c
index 3183635acbaed6cada22c41e6e0c8c03c4e527cc..ee1d3289d3853cda215208b390f3900e0d6acd9b 100644 (file)
--- a/src/out.c
+++ b/src/out.c
@@ -6,12 +6,16 @@
 
 extern FILE *out;
 extern FILE *outh;
+extern FILE *outph;
+
+extern gboolean for_cpp;
 
 extern char *filename;
 extern char *filebase;
 
 int outline = 1;
 int outhline = 1;
+int outphline = 1;
 
 static int
 strchrcnt(char *s, char c)
@@ -37,6 +41,8 @@ out_printf(FILE *fp,char *format,...)
                outline += strchrcnt(s,'\n');
        else if(fp == outh)
                outhline += strchrcnt(s,'\n');
+       else if(fp == outph)
+               outphline += strchrcnt(s,'\n');
        else
                g_assert_not_reached();
 
@@ -51,6 +57,8 @@ out_addline_infile(FILE *fp, int line)
                outline++;
        else if(fp == outh)
                outhline++;
+       else if(fp == outph)
+               outphline++;
        else
                g_assert_not_reached();
 
@@ -62,10 +70,16 @@ out_addline_outfile(FILE *fp)
 {
        if(fp == out) {
                outline++;
-               fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase);
+               if(!for_cpp)
+                       fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase);
+               else
+                       fprintf(fp,"#line %d \"%s.cc\"\n",outline,filebase);
        } else if(fp == outh) {
                outhline++;
                fprintf(fp,"#line %d \"%s.h\"\n",outhline,filebase);
+       } else if(fp == outph) {
+               outphline++;
+               fprintf(fp,"#line %d \"%s-private.h\"\n",outphline,filebase);
        } else
                g_assert_not_reached();