Registry server LDB backend: Don't make copies of the same type
[kai/samba-autobuild/.git] / source3 / popt / system.h
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #if defined (__GLIBC__) && defined(__LCLINT__)
6 /*@-declundef@*/
7 /*@unchecked@*/
8 extern __const __int32_t *__ctype_tolower;
9 /*@unchecked@*/
10 extern __const __int32_t *__ctype_toupper;
11 /*@=declundef@*/
12 #endif
13
14 #include <ctype.h>
15
16 #include <errno.h>
17 #include <fcntl.h>
18 #include <limits.h>
19
20 #if HAVE_MCHECK_H 
21 #include <mcheck.h>
22 #endif
23
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27
28 #if HAVE_UNISTD_H
29 #include <unistd.h>
30 #endif
31
32 #ifdef __NeXT
33 /* access macros are not declared in non posix mode in unistd.h -
34  don't try to use posix on NeXTstep 3.3 ! */
35 #include <libc.h>
36 #endif
37
38 #if defined(__LCLINT__)
39 /*@-declundef -incondefs -redecl@*/ /* LCL: missing annotation */
40 /*@only@*/ void * alloca (size_t __size)
41         /*@ensures MaxSet(result) == (__size - 1) @*/
42         /*@*/;
43 /*@=declundef =incondefs =redecl@*/
44 #endif
45
46 /* AIX requires this to be the first thing in the file.  */ 
47 #ifndef __GNUC__
48 # if HAVE_ALLOCA_H
49 #  include <alloca.h>
50 # else
51 #  ifdef _AIX
52 #pragma alloca
53 #  else
54 #   ifndef alloca /* predefined by HP cc +Olibcalls */
55 char *alloca ();
56 #   endif
57 #  endif
58 # endif
59 #elif defined(__GNUC__) && defined(__STRICT_ANSI__)
60 #define alloca __builtin_alloca
61 #endif
62
63 /*@-redecl -redef@*/
64 /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
65         /*@*/;
66 /*@=redecl =redef@*/
67
68 #if HAVE_MCHECK_H && defined(__GNUC__)
69 #define vmefail()       (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL)
70 #define xstrdup(_str)   (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
71 #else
72 #define xstrdup(_str)   strdup(_str)
73 #endif  /* HAVE_MCHECK_H && defined(__GNUC__) */
74
75
76 #include "popt.h"