From 34495ef7b97f3220462c974f06f1cd9c652f2a03 Mon Sep 17 00:00:00 2001 From: Teddy Date: Fri, 11 Apr 2014 22:26:03 +0800 Subject: more elegant const --- const.h | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/const.h b/const.h index 9e242c0..80ef83a 100644 --- a/const.h +++ b/const.h @@ -1,21 +1,25 @@ -#define EXP_POSTFIX 1024 -#define POSTFIX_ARR 1025 -#define POSTFIX_CALL 1026 -#define POSTFIX_DOT 1027 -#define POSTFIX_PTR 1028 -#define EXP_CAST 1029 -#define INITR_NORM 1030 -#define INITR_ARR 1031 -#define DECLR_FUNC 1032 -#define DECLR_ARR 1033 -#define STMT_EXP 1034 -#define STMT_COMP 1035 -#define STMT_IF 1036 -#define STMT_WHILE 1037 -#define STMT_FOR 1038 -#define STMT_CONT 1039 -#define STMT_BREAK 1040 -#define STMT_RET 1041 +#ifndef CONST_H +#define CONST_H +enum { + EXP_POSTFIX = 1024, + POSTFIX_ARR, + POSTFIX_CALL, + POSTFIX_DOT, + POSTFIX_PTR, + EXP_CAST, + INITR_NORM, + INITR_ARR, + DECLR_FUNC, + DECLR_ARR, + STMT_EXP, + STMT_COMP, + STMT_IF, + STMT_WHILE, + STMT_FOR, + STMT_CONT, + STMT_BREAK, + STMT_RET +}; #define MAX_CHDN 1024 #define MAX_DEBUG_PRINT_BUFF 1024 @@ -26,3 +30,4 @@ #define CHAR_SIZE 1 #define EXT_LINKAGE 1 #define NO_LINKAGE 0 +#endif -- cgit v1.2.3-70-g09d2