source: castxml/trunk/fuentes/test/cc-msvc.c @ 6513

Last change on this file since 6513 was 6513, checked in by mabarracus, 2 years ago

Initial port to lliurex from ubuntu

File size: 769 bytes
Line 
1#include <stdio.h>
2#include <string.h>
3
4int main(int argc, const char* argv[])
5{
6  int cpp = 0;
7  const char* msc_ver = "1600";
8  int i;
9  for (i = 1; i < argc; ++i) {
10    if (strncmp(argv[i], "--cc-define=", 12) == 0) {
11      fprintf(stdout, "\n#define %s 1", argv[i]+12);
12    } else if (strncmp(argv[i], "-msc=", 5) == 0) {
13      msc_ver = argv[i]+5;
14    } else if (strstr(argv[i], ".cpp")) {
15      cpp = 1;
16    }
17  }
18  fprintf(stdout,
19    "\n"
20    );
21  if (cpp) {
22    fprintf(stdout,
23      "#define __cplusplus 199711L\n"
24      );
25  }
26  fprintf(stdout,
27    "#define _MSC_VER %s\n", msc_ver
28    );
29  fprintf(stdout,
30    "#define __has_include(x) x\n"
31    "#define __has_include_next(x) x\n"
32    "#define _WIN32 1\n"
33    "#define __has_last(x) x"
34    );
35  return 0;
36}
Note: See TracBrowser for help on using the repository browser.