From 3a7606f4d94f12a1db2da80d42402eb904bf464b Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 28 Aug 2014 14:55:15 +0200 Subject: [PATCH] extract out isl_multi_macro.h The macro definitions in isl_multi_templ.h and isl_multi_templ.c were essentially duplicates. Combine them into a single file. We will also be able to reuse this file in the next commit. Signed-off-by: Sven Verdoolaege --- Makefile.am | 1 + isl_multi_macro.h | 8 ++++++++ isl_multi_templ.c | 10 ++-------- isl_multi_templ.h | 7 +------ 4 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 isl_multi_macro.h diff --git a/Makefile.am b/Makefile.am index 4fec15bb..d5d35e8a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -283,6 +283,7 @@ EXTRA_DIST = \ isl_list_templ.c \ isl_list_templ.h \ isl_map_lexopt_templ.c \ + isl_multi_macro.h \ isl_multi_templ.c \ isl_multi_templ.h \ print_templ.c \ diff --git a/isl_multi_macro.h b/isl_multi_macro.h new file mode 100644 index 00000000..3b07bef0 --- /dev/null +++ b/isl_multi_macro.h @@ -0,0 +1,8 @@ +#define xCAT(A,B) A ## B +#define CAT(A,B) xCAT(A,B) +#undef EL +#define EL CAT(isl_,BASE) +#define xFN(TYPE,NAME) TYPE ## _ ## NAME +#define FN(TYPE,NAME) xFN(TYPE,NAME) +#define xMULTI(BASE) isl_multi_ ## BASE +#define MULTI(BASE) xMULTI(BASE) diff --git a/isl_multi_templ.c b/isl_multi_templ.c index 4ef2d696..56869e2d 100644 --- a/isl_multi_templ.c +++ b/isl_multi_templ.c @@ -12,14 +12,8 @@ #include #include -#define xCAT(A,B) A ## B -#define CAT(A,B) xCAT(A,B) -#undef EL -#define EL CAT(isl_,BASE) -#define xFN(TYPE,NAME) TYPE ## _ ## NAME -#define FN(TYPE,NAME) xFN(TYPE,NAME) -#define xMULTI(BASE) isl_multi_ ## BASE -#define MULTI(BASE) xMULTI(BASE) +#include + #define MULTI_NAME(BASE) "isl_multi_" #BASE #define xLIST(EL) EL ## _list #define LIST(EL) xLIST(EL) diff --git a/isl_multi_templ.h b/isl_multi_templ.h index 342d9a22..8170892e 100644 --- a/isl_multi_templ.h +++ b/isl_multi_templ.h @@ -1,11 +1,6 @@ #include -#define xCAT(A,B) A ## B -#define CAT(A,B) xCAT(A,B) -#undef EL -#define EL CAT(isl_,BASE) -#define xMULTI(BASE) isl_multi_ ## BASE -#define MULTI(BASE) xMULTI(BASE) +#include struct MULTI(BASE) { int ref; -- 2.11.4.GIT