#endif
#include <string.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
#include "list.h"
#include "miscutil.h"
+#ifndef NDEBUG
static int list_is_valid (const struct list *the_list);
-
+#endif
/*********************************************************************
*
}
+#ifndef NDEBUG
/*********************************************************************
*
* Function : list_is_valid
* Description : Check that a string list is valid. The intended
* usage is "assert(list_is_valid(the_list))".
* Currently this checks that "the_list->last"
- * is correct, and that the list dosn't contain
+ * is correct, and that the list doesn't contain
* circular references. It is likely to crash if
* it's passed complete garbage.
*
*********************************************************************/
static int list_is_valid (const struct list *the_list)
{
- /*
- * If you don't want this check, just change the line below
- * from "#if 1" to "#if 0".
- */
-#if 1
const struct list_entry *cur_entry;
const struct list_entry *last_entry = NULL;
int entry = 0;
}
return (the_list->last == last_entry);
-#else
- return 1;
-#endif
+
}
+#endif /* ndef NDEBUG */
+
/*********************************************************************
*
* 2 : name = name parameter to look for
*
* Returns : the value if found, else the empty string.
- * Return value is alloced as part of the map, so
+ * Return value is allocated as part of the map, so
* it is freed when the map is destroyed. Caller
* must not free or modify it.
*