comparison dmd/mars.c @ 1640:9bf06e02070b

Merge DMD 1.057.
author Christian Kamm <kamm incasoftware de>
date Mon, 08 Mar 2010 21:39:20 +0100
parents 44b145be2ef5
children
comparison
equal deleted inserted replaced
1639:41145d30acb8 1640:9bf06e02070b
59 obj_ext = "o"; 59 obj_ext = "o";
60 #if _WIN32 60 #if _WIN32
61 obj_ext_alt = "obj"; 61 obj_ext_alt = "obj";
62 #endif 62 #endif
63 63
64 copyright = "Copyright (c) 1999-2009 by Digital Mars and Tomas Lindquist Olsen"; 64 copyright = "Copyright (c) 1999-2010 by Digital Mars and Tomas Lindquist Olsen";
65 written = "written by Walter Bright and Tomas Lindquist Olsen"; 65 written = "written by Walter Bright and Tomas Lindquist Olsen";
66 version = "v1.056"; 66 version = "v1.057";
67 ldc_version = LDC_REV; 67 ldc_version = LDC_REV;
68 llvm_version = LLVM_REV_STR; 68 llvm_version = LLVM_REV_STR;
69 global.structalign = 8; 69 global.structalign = 8;
70 70
71 // This should only be used as a global, so the other fields are 71 // This should only be used as a global, so the other fields are
114 va_end( ap ); 114 va_end( ap );
115 } 115 }
116 116
117 void warning(Loc loc, const char *format, ...) 117 void warning(Loc loc, const char *format, ...)
118 { 118 {
119 if (global.params.warnings && !global.gag) 119 va_list ap;
120 { 120 va_start(ap, format);
121 va_list ap; 121 vwarning(loc, format, ap);
122 va_start(ap, format); 122 va_end( ap );
123 vwarning(loc, format, ap);
124 va_end( ap );
125 }
126 } 123 }
127 124
128 void verror(Loc loc, const char *format, va_list ap) 125 void verror(Loc loc, const char *format, va_list ap)
129 { 126 {
130 if (!global.gag) 127 if (!global.gag)
145 142
146 void vwarning(Loc loc, const char *format, va_list ap) 143 void vwarning(Loc loc, const char *format, va_list ap)
147 { 144 {
148 if (global.params.warnings && !global.gag) 145 if (global.params.warnings && !global.gag)
149 { 146 {
150 char *p = loc.toChars(); 147 char *p = loc.toChars();
151 148
152 if (*p) 149 if (*p)
153 fprintf(stdmsg, "%s: ", p); 150 fprintf(stdmsg, "%s: ", p);
154 mem.free(p); 151 mem.free(p);
155 152
156 fprintf(stdmsg, "Warning: "); 153 fprintf(stdmsg, "Warning: ");
157 vfprintf(stdmsg, format, ap); 154 #if _MSC_VER
158 fprintf(stdmsg, "\n"); 155 // MS doesn't recognize %zu format
159 fflush(stdmsg); 156 OutBuffer tmp;
157 tmp.vprintf(format, ap);
158 fprintf(stdmsg, "%s", tmp.toChars());
159 #else
160 vfprintf(stdmsg, format, ap);
161 #endif
162 fprintf(stdmsg, "\n");
163 fflush(stdmsg);
164 //halt();
165 if (global.params.warnings == 1)
166 global.warnings++; // warnings don't count if gagged
160 } 167 }
161 } 168 }
162 169
163 /*************************************** 170 /***************************************
164 * Call this after printing out fatal error messages to clean up and exit 171 * Call this after printing out fatal error messages to clean up and exit
181 { 188 {
182 #ifdef DEBUG 189 #ifdef DEBUG
183 *(char*)0=0; 190 *(char*)0=0;
184 #endif 191 #endif
185 } 192 }
193
186 194
187 /*********************************** 195 /***********************************
188 * Parse and append contents of environment variable envvar 196 * Parse and append contents of environment variable envvar
189 * to argc and argv[]. 197 * to argc and argv[].
190 * The string is separated into arguments, processing \ and ". 198 * The string is separated into arguments, processing \ and ".