Commit b640ec57 authored by Niels Möller's avatar Niels Möller
Browse files

Define _GNU_SOURCE (kludge). Rearranged string headers.

Rev: src/lsh_types.h:1.12
parent f378ab4b
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
#include "config.h" #include "config.h"
#endif #endif
/* FIXME: This should probably be set in config.h by autoconf */
/* The crypt function requires _XOPEN_SOURCE, while the initgroups
* function requires _BSD_SOURCE */
#define _GNU_SOURCE
#if SIZEOF_SHORT >= 4 #if SIZEOF_SHORT >= 4
#define UINT32 unsigned short #define UINT32 unsigned short
...@@ -85,20 +90,27 @@ do { \ ...@@ -85,20 +90,27 @@ do { \
struct lsh_object struct lsh_object
{ {
int type; /* Zero for objects that are not allocated on the heap. */ int size; /* Zero for objects that are not allocated on the heap. */
};
struct lsh_string_header
{
int magic;
}; };
#define STATIC_HEADER { 0 }, #define STATIC_HEADER { 0 },
#else /* !DEBUG_ALLOC */ #else /* !DEBUG_ALLOC */
struct lsh_object {}; struct lsh_object {};
struct lsh_string_header {};
#define STATIC_HEADER #define STATIC_HEADER
#endif /* !DEBUG_ALLOC */ #endif /* !DEBUG_ALLOC */
struct lsh_string struct lsh_string
{ {
struct lsh_object header; struct lsh_string_header header;
UINT32 sequence_number; UINT32 sequence_number;
/* NOTE: The allocated size may be larger than the string length. */ /* NOTE: The allocated size may be larger than the string length. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment