changeset 88:021fe1a818c3

Small cleanup to prepare for cross-compile friendly make install.
author Rob Landley <rob@landley.net>
date Wed, 31 Jan 2007 13:31:19 -0500
parents 44c7bcd02db6
children 4f5cdc6552da
files main.c toys/toylist.h
diffstat 2 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Wed Jan 31 12:28:50 2007 -0500
+++ b/main.c	Wed Jan 31 13:31:19 2007 -0500
@@ -8,8 +8,12 @@
 
 // Populate toy_list[].
 
+#undef NEWTOY
+#undef OLDTOY
+#define NEWTOY(name, opts, flags) {#name, name##_main, opts, flags},
+#define OLDTOY(name, oldname, opts, flags) {#name, oldname##_main, opts, flags},
+
 struct toy_list toy_list[] = {
-#define FROM_MAIN
 #include "toys/toylist.h"
 };
 
--- a/toys/toylist.h	Wed Jan 31 12:28:50 2007 -0500
+++ b/toys/toylist.h	Wed Jan 31 13:31:19 2007 -0500
@@ -5,18 +5,10 @@
  */
 
 
-// When #included from main.c, provide the guts for toy_list[]
+// Provide function declarations and structs.  Note that main.c #includes this
+// file twice (with different macros) to populate toy_list[].
 
-#ifdef FROM_MAIN
-#undef NEWTOY
-#undef OLDTOY
-#define NEWTOY(name, opts, flags) {#name, name##_main, opts, flags},
-#define OLDTOY(name, oldname, opts, flags) {#name, oldname##_main, opts, flags},
-
-// When #included from toys.h, provide function declarations and structs.
-// The #else is because main.c #includes this file twice.
-
-#else
+#ifndef NEWTOY
 #define NEWTOY(name, opts, flags) int name##_main(void);
 #define OLDTOY(name, oldname, opts, flags)