From 5e3ef5153fe6aa2190ffa185009fa45e3549469d Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 1 Dec 2013 17:02:28 +0100 Subject: Generate a x_server_routine in the sheader so it can be inlined * header.c (WriteServerHeader): Emit a x_server_routine that can be inlined. * server.c (WriteEpilog): Export the x_routines array so it can be used from the inlined x_server_routine. --- header.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'header.c') diff --git a/header.c b/header.c index 1bc570f..23e5686 100644 --- a/header.c +++ b/header.c @@ -154,6 +154,8 @@ WriteServerHeader(FILE *file, const statement_t *stats) const char *protect = strconcat(SubsystemName, "_server_"); WriteProlog(file, protect); + fprintf(file, "#include \n"); /* For mig_routine_t. */ + for (stat = stats; stat != stNULL; stat = stat->stNext) switch (stat->stKind) { @@ -170,6 +172,14 @@ WriteServerHeader(FILE *file, const statement_t *stats) fatal("WriteServerHeader(): bad statement_kind_t (%d)", (int) stat->stKind); } + fprintf(file, "\n"); + + /* + * Include the x_server_routine function so it can be inlined. + */ + fprintf(file, "extern mig_routine_t %s_routines[];\n", ServerDemux); + WriteSubsystemServerRoutine(file, "extern inline"); + WriteEpilog(file, protect); } -- cgit v1.2.3