Changeset 148

Show
Ignore:
Timestamp:
03/13/09 10:42:46 (15 years ago)
Author:
bhilburn
Message:

ERROR and WARNING functions now support a variable number of arguments, and are
compatible with C-code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/bhilburn/src/include/vtcross/error.h

    r145 r148  
    1111#define ERROR_H 
    1212 
    13 #include <iostream> 
     13#include <cstdio> 
    1414 
    15 void ERROR(int exit_code, char* msg) 
    16 { 
    17     std::cerr << msg << std::endl; 
     15#define ERROR(exit_code, ...) \ 
     16    fprintf(stderr, __VA_ARGS__); \ 
    1817    exit(exit_code); 
    19 } 
    2018 
    21 void WARNING(char* msg) 
    22 { 
    23     std::cerr << msg << std::endl; 
    24 } 
     19#define WARNING(...) \ 
     20    fprintf(stderr, __VA_ARGS__); 
    2521 
    2622#endif