Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys use __COMPAT so that we get argument expansion.



details:   https://anonhg.NetBSD.org/src/rev/1e7d3c3fc458
branches:  trunk
changeset: 806722:1e7d3c3fc458
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Mar 07 03:19:06 2015 +0000

description:
use __COMPAT so that we get argument expansion.

diffstat:

 sys/sys/module.h |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (47 lines):

diff -r 156ad0d6146a -r 1e7d3c3fc458 sys/sys/module.h
--- a/sys/sys/module.h  Fri Mar 06 22:29:06 2015 +0000
+++ b/sys/sys/module.h  Sat Mar 07 03:19:06 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: module.h,v 1.35 2014/04/23 23:25:45 pooka Exp $        */
+/*     $NetBSD: module.h,v 1.36 2015/03/07 03:19:06 christos Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -114,11 +114,11 @@
 };
 LIST_HEAD(modinfo_boot_chain, modinfo_chain);
 #define _MODULE_REGISTER(name)                                         \
-static void modctor_##name(void) __attribute__((constructor));         \
-static void modctor_##name(void)                                       \
+static void __CONCAT(modctor_,name)(void) __attribute__((__constructor__));\
+static void __CONCAT(modctor_,name)(void)                              \
 {                                                                      \
        static struct modinfo_chain mc = {                              \
-               .mc_info = &name##_modinfo,                             \
+               .mc_info = &__CONCAT(name,_modinfo),                    \
        };                                                              \
        extern struct modinfo_boot_chain modinfo_boot_chain;            \
        LIST_INSERT_HEAD(&modinfo_boot_chain, &mc, mc_entries);         \
@@ -126,17 +126,17 @@
 
 #else /* RUMP_USE_CTOR */
 
-#define _MODULE_REGISTER(name) __link_set_add_rodata(modules, name##_modinfo);
+#define _MODULE_REGISTER(name) __link_set_add_rodata(modules, __CONCAT(name,_modinfo));
 
 #endif /* RUMP_USE_CTOR */
 
 #define        MODULE(class, name, required)                           \
-static int name##_modcmd(modcmd_t, void *);                    \
-static const modinfo_t name##_modinfo = {                      \
+static int __CONCAT(name,_modcmd)(modcmd_t, void *);           \
+static const modinfo_t __CONCAT(name,_modinfo) = {             \
        .mi_version = __NetBSD_Version__,                       \
        .mi_class = (class),                                    \
-       .mi_modcmd = name##_modcmd,                             \
-       .mi_name = #name,                                       \
+       .mi_modcmd = __CONCAT(name,_modcmd),                    \
+       .mi_name = __STRING(name),                              \
        .mi_required = (required)                               \
 };                                                             \
 _MODULE_REGISTER(name)



Home | Main Index | Thread Index | Old Index