generator.cxx 406 Bytes
Newer Older
Ken Martin's avatar
Ken Martin committed
1 2
#include <stdio.h>

3
int main(int argc, char* argv[])
Ken Martin's avatar
Ken Martin committed
4
{
5
  if (argc < 2) {
6 7
    fprintf(stderr, "Usage: %s <file>\n", argv[0]);
    return 1;
8 9
  }
  FILE* fp = fopen(argv[1], "w");
10
#ifdef GENERATOR_EXTERN
11
  fprintf(fp, "int generated() { return 3; }\n");
12
#else
13 14
  fprintf(fp, "extern int gen_redirect(void);\n");
  fprintf(fp, "int generated() { return gen_redirect(); }\n");
15
#endif
Ken Martin's avatar
Ken Martin committed
16
  fclose(fp);
Bill Hoffman's avatar
Bill Hoffman committed
17
  return 0;
Ken Martin's avatar
Ken Martin committed
18
}