Move elements() to nasmlib.h
authorH. Peter Anvin <hpa@zytor.com>
Fri, 9 Nov 2007 03:30:22 +0000 (19:30 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 9 Nov 2007 03:30:22 +0000 (19:30 -0800)
Move elements() to nasmlib.h; that is the best place for this kind of
utility macros.

nasm.h
nasmlib.h

diff --git a/nasm.h b/nasm.h
index 2c96a4c..9cfd77e 100644 (file)
--- a/nasm.h
+++ b/nasm.h
@@ -963,19 +963,6 @@ enum special_tokens {
 
 /*
  * -----
- * Other
- * -----
- */
-
-/*
- * This is a useful #define which I keep meaning to use more often:
- * the number of elements of a statically defined array.
- */
-
-#define elements(x)     ( sizeof(x) / sizeof(*(x)) )
-
-/*
- * -----
  * Global modes
  * -----
  */
index aed490e..560ec1e 100644 (file)
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -163,6 +163,16 @@ void standard_extension(char *inname, char *outname, char *extension,
 #endif
 
 /*
+ * Utility macros...
+ *
+ * This is a useful #define which I keep meaning to use more often:
+ * the number of elements of a statically defined array.
+ */
+
+#define elements(x)     ( sizeof(x) / sizeof(*(x)) )
+
+
+/*
  * some handy macros that will probably be of use in more than one
  * output format: convert integers into little-endian byte packed
  * format in memory