return ln;
}
+#ifndef QCVM_EXECUTOR
/*
* Utility console message writes for lexer contexts. These will allow
* for reporting of file:line based on lexer context, These are used
va_end(ap);
return r;
}
+#endif
void opts_backup_non_Werror_all(void);
void opts_restore_non_Werror_all(void);
+
enum {
# define GMQCC_TYPE_FLAGS
# define GMQCC_DEFINE_FLAG(X) X,
# include "opts.def"
COUNT_FLAGS
};
-static const opts_flag_def opts_flag_list[] = {
-# define GMQCC_TYPE_FLAGS
-# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(X) },
-# include "opts.def"
- { NULL, LONGBIT(0) }
-};
enum {
# define GMQCC_TYPE_WARNS
# include "opts.def"
COUNT_WARNINGS
};
-static const opts_flag_def opts_warn_list[] = {
-# define GMQCC_TYPE_WARNS
-# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(WARN_##X) },
-# include "opts.def"
- { NULL, LONGBIT(0) }
-};
enum {
# define GMQCC_TYPE_OPTIMIZATIONS
# include "opts.def"
COUNT_OPTIMIZATIONS
};
-static const opts_flag_def opts_opt_list[] = {
-# define GMQCC_TYPE_OPTIMIZATIONS
-# define GMQCC_DEFINE_FLAG(NAME, MIN_O) { #NAME, LONGBIT(OPTIM_##NAME) },
-# include "opts.def"
- { NULL, LONGBIT(0) }
-};
-static const unsigned int opts_opt_oflag[] = {
-# define GMQCC_TYPE_OPTIMIZATIONS
-# define GMQCC_DEFINE_FLAG(NAME, MIN_O) MIN_O,
-# include "opts.def"
- 0
-};
enum {
# define GMQCC_TYPE_OPTIONS
OPTION_COUNT
};
-extern unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
+extern const opts_flag_def opts_flag_list[COUNT_FLAGS+1];
+extern const opts_flag_def opts_warn_list[COUNT_WARNINGS+1];
+extern const opts_flag_def opts_opt_list[COUNT_OPTIMIZATIONS+1];
+extern const unsigned int opts_opt_oflag[COUNT_OPTIMIZATIONS+1];
+extern unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
/* other options: */
typedef enum {
#objects
OBJ_C = main.o lexer.o parser.o fs.o stat.o util.o code.o ast.o ir.o conout.o ftepp.o opts.o utf8.o correct.o
OBJ_P = util.o fs.o conout.o opts.o pak.o stat.o
-OBJ_T = test.o util.o conout.o fs.o stat.o
-OBJ_X = exec-standalone.o util.o conout.o fs.o stat.o
+OBJ_T = test.o util.o opts.o conout.o fs.o stat.o
+OBJ_X = exec-standalone.o util.o opts.o conout.o fs.o stat.o
#gource flags
GOURCEFLAGS = \
#define TYPE_ASM 1
#define TYPE_SRC 2
-
static const char *app_name;
static void version(void) {
#include "gmqcc.h"
+const unsigned int opts_opt_oflag[COUNT_OPTIMIZATIONS+1] = {
+# define GMQCC_TYPE_OPTIMIZATIONS
+# define GMQCC_DEFINE_FLAG(NAME, MIN_O) MIN_O,
+# include "opts.def"
+ 0
+};
+
+const opts_flag_def opts_opt_list[COUNT_OPTIMIZATIONS+1] = {
+# define GMQCC_TYPE_OPTIMIZATIONS
+# define GMQCC_DEFINE_FLAG(NAME, MIN_O) { #NAME, LONGBIT(OPTIM_##NAME) },
+# include "opts.def"
+ { NULL, LONGBIT(0) }
+};
+
+const opts_flag_def opts_warn_list[COUNT_WARNINGS+1] = {
+# define GMQCC_TYPE_WARNS
+# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(WARN_##X) },
+# include "opts.def"
+ { NULL, LONGBIT(0) }
+};
+
+const opts_flag_def opts_flag_list[COUNT_FLAGS+1] = {
+# define GMQCC_TYPE_FLAGS
+# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(X) },
+# include "opts.def"
+ { NULL, LONGBIT(0) }
+};
+
unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
opts_cmd_t opts; /* command lien options */
size_t line;
FILE *ini;
-
if (!file) {
/* try ini */
if (!(ini = fs_file_open((file = "gmqcc.ini"), "r")))