diff toys/posix/uname.c @ 674:7e846e281e38

New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
author Rob Landley <rob@landley.net>
date Mon, 08 Oct 2012 00:02:30 -0500
parents 6df4ccc0acbe
children fa858a67e231
line wrap: on
line diff
--- a/toys/posix/uname.c	Sun Oct 07 23:53:25 2012 -0500
+++ b/toys/posix/uname.c	Mon Oct 08 00:02:30 2012 -0500
@@ -24,6 +24,7 @@
 	  -a	All of the above
 */
 
+#define FOR_uname
 #include "toys.h"
 
 // If a 32 bit x86 build environment working in a chroot under an x86-64
@@ -39,15 +40,13 @@
 #define GROSS "i386"
 #endif
 
-#define FLAG_a (1<<5)
-
 void uname_main(void)
 {
 	int i, flags = toys.optflags, needspace=0;
 
 	uname((void *)toybuf);
 
-	if (!flags) flags=1;
+	if (!flags) flags = FLAG_s;
 	for (i=0; i<5; i++) {
 		char *c = toybuf+(65*i);