Commit bb2d4862 authored by Alexandre Julliard's avatar Alexandre Julliard

d3dcompiler: Use the standard va_list instead of __ms_va_list.

parent 1303364f
...@@ -30,11 +30,11 @@ struct asm_parser asm_ctx; ...@@ -30,11 +30,11 @@ struct asm_parser asm_ctx;
void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt, ...) void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt, ...)
{ {
__ms_va_list args; va_list args;
__ms_va_start(args, fmt); va_start(args, fmt);
compilation_message(&ctx->messages, fmt, args); compilation_message(&ctx->messages, fmt, args);
__ms_va_end(args); va_end(args);
} }
static void asmshader_error(char const *s) { static void asmshader_error(char const *s) {
......
...@@ -83,7 +83,7 @@ static CRITICAL_SECTION_DEBUG wpp_mutex_debug = ...@@ -83,7 +83,7 @@ static CRITICAL_SECTION_DEBUG wpp_mutex_debug =
static CRITICAL_SECTION wpp_mutex = { &wpp_mutex_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION wpp_mutex = { &wpp_mutex_debug, -1, 0, 0, 0, 0 };
/* Preprocessor error reporting functions */ /* Preprocessor error reporting functions */
static void wpp_write_message(const char *fmt, __ms_va_list args) static void wpp_write_message(const char *fmt, va_list args)
{ {
char* newbuffer; char* newbuffer;
int rc, newsize; int rc, newsize;
...@@ -125,37 +125,37 @@ static void wpp_write_message(const char *fmt, __ms_va_list args) ...@@ -125,37 +125,37 @@ static void wpp_write_message(const char *fmt, __ms_va_list args)
static void WINAPIV PRINTF_ATTR(1,2) wpp_write_message_var(const char *fmt, ...) static void WINAPIV PRINTF_ATTR(1,2) wpp_write_message_var(const char *fmt, ...)
{ {
__ms_va_list args; va_list args;
__ms_va_start(args, fmt); va_start(args, fmt);
wpp_write_message(fmt, args); wpp_write_message(fmt, args);
__ms_va_end(args); va_end(args);
} }
int WINAPIV ppy_error(const char *msg, ...) int WINAPIV ppy_error(const char *msg, ...)
{ {
__ms_va_list ap; va_list ap;
__ms_va_start(ap, msg); va_start(ap, msg);
wpp_write_message_var("%s:%d:%d: %s: ", wpp_write_message_var("%s:%d:%d: %s: ",
pp_status.input ? pp_status.input : "'main file'", pp_status.input ? pp_status.input : "'main file'",
pp_status.line_number, pp_status.char_number, "Error"); pp_status.line_number, pp_status.char_number, "Error");
wpp_write_message(msg, ap); wpp_write_message(msg, ap);
wpp_write_message_var("\n"); wpp_write_message_var("\n");
__ms_va_end(ap); va_end(ap);
pp_status.state = 1; pp_status.state = 1;
return 1; return 1;
} }
int WINAPIV ppy_warning(const char *msg, ...) int WINAPIV ppy_warning(const char *msg, ...)
{ {
__ms_va_list ap; va_list ap;
__ms_va_start(ap, msg); va_start(ap, msg);
wpp_write_message_var("%s:%d:%d: %s: ", wpp_write_message_var("%s:%d:%d: %s: ",
pp_status.input ? pp_status.input : "'main file'", pp_status.input ? pp_status.input : "'main file'",
pp_status.line_number, pp_status.char_number, "Warning"); pp_status.line_number, pp_status.char_number, "Warning");
wpp_write_message(msg, ap); wpp_write_message(msg, ap);
wpp_write_message_var("\n"); wpp_write_message_var("\n");
__ms_va_end(ap); va_end(ap);
return 0; return 0;
} }
......
...@@ -269,7 +269,7 @@ struct bwriter_shader *parse_asm_shader(char **messages) DECLSPEC_HIDDEN; ...@@ -269,7 +269,7 @@ struct bwriter_shader *parse_asm_shader(char **messages) DECLSPEC_HIDDEN;
#define PRINTF_ATTR(fmt,args) #define PRINTF_ATTR(fmt,args)
#endif #endif
void compilation_message(struct compilation_messages *msg, const char *fmt, __ms_va_list args) DECLSPEC_HIDDEN; void compilation_message(struct compilation_messages *msg, const char *fmt, va_list args) DECLSPEC_HIDDEN;
void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt, ...) PRINTF_ATTR(2,3) DECLSPEC_HIDDEN; void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt, ...) PRINTF_ATTR(2,3) DECLSPEC_HIDDEN;
static inline void set_parse_status(enum parse_status *current, enum parse_status update) static inline void set_parse_status(enum parse_status *current, enum parse_status update)
{ {
......
...@@ -287,7 +287,7 @@ includelogicentry_t *pp_includelogiclist = NULL; ...@@ -287,7 +287,7 @@ includelogicentry_t *pp_includelogiclist = NULL;
void WINAPIV pp_writestring(const char *format, ...) void WINAPIV pp_writestring(const char *format, ...)
{ {
__ms_va_list valist; va_list valist;
int len; int len;
static char *buffer; static char *buffer;
static int buffercapacity; static int buffercapacity;
...@@ -301,10 +301,10 @@ void WINAPIV pp_writestring(const char *format, ...) ...@@ -301,10 +301,10 @@ void WINAPIV pp_writestring(const char *format, ...)
buffercapacity = BUFFERINITIALCAPACITY; buffercapacity = BUFFERINITIALCAPACITY;
} }
__ms_va_start(valist, format); va_start(valist, format);
len = vsnprintf(buffer, buffercapacity, len = vsnprintf(buffer, buffercapacity,
format, valist); format, valist);
__ms_va_end(valist); va_end(valist);
/* If the string is longer than buffersize, vsnprintf returns /* If the string is longer than buffersize, vsnprintf returns
* the string length with glibc >= 2.1, -1 with glibc < 2.1 */ * the string length with glibc >= 2.1, -1 with glibc < 2.1 */
while(len > buffercapacity || len < 0) while(len > buffercapacity || len < 0)
...@@ -318,10 +318,10 @@ void WINAPIV pp_writestring(const char *format, ...) ...@@ -318,10 +318,10 @@ void WINAPIV pp_writestring(const char *format, ...)
if(new_buffer == NULL) if(new_buffer == NULL)
return; return;
buffer = new_buffer; buffer = new_buffer;
__ms_va_start(valist, format); va_start(valist, format);
len = vsnprintf(buffer, buffercapacity, len = vsnprintf(buffer, buffercapacity,
format, valist); format, valist);
__ms_va_end(valist); va_end(valist);
} }
wpp_write(buffer, len); wpp_write(buffer, len);
......
...@@ -437,11 +437,11 @@ int pp_get_if_depth(void) ...@@ -437,11 +437,11 @@ int pp_get_if_depth(void)
void WINAPIV pp_internal_error(const char *file, int line, const char *s, ...) void WINAPIV pp_internal_error(const char *file, int line, const char *s, ...)
{ {
__ms_va_list ap; va_list ap;
__ms_va_start(ap, s); va_start(ap, s);
fprintf(stderr, "Internal error (please report) %s %d: ", file, line); fprintf(stderr, "Internal error (please report) %s %d: ", file, line);
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
__ms_va_end(ap); va_end(ap);
exit(3); exit(3);
} }
...@@ -716,7 +716,7 @@ HRESULT dxbc_write_blob(struct dxbc *dxbc, ID3DBlob **blob) ...@@ -716,7 +716,7 @@ HRESULT dxbc_write_blob(struct dxbc *dxbc, ID3DBlob **blob)
return S_OK; return S_OK;
} }
void compilation_message(struct compilation_messages *msg, const char *fmt, __ms_va_list args) void compilation_message(struct compilation_messages *msg, const char *fmt, va_list args)
{ {
char* buffer; char* buffer;
int rc, size; int rc, size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment