Fix bug 9519 - Samba returns unexpected error on SMB posix open.
[Samba/vl.git] / lib / popt / system.h
blobbbb4f6cc264b3e7bd9ebb09ff1b6862af4c31b86
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
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
14 #include <ctype.h>
16 #include <errno.h>
17 #include <fcntl.h>
18 #include <limits.h>
20 #if HAVE_MCHECK_H
21 #include <mcheck.h>
22 #endif
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
28 #if HAVE_UNISTD_H
29 #include <unistd.h>
30 #endif
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
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
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 #elif defined(__GNUC__) && defined(HAVE_ALLOCA_H)
62 # include <alloca.h>
63 #endif
65 /*@-redecl -redef@*/
66 /*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
67 /*@*/;
68 /*@=redecl =redef@*/
70 #if HAVE_MCHECK_H && defined(__GNUC__)
71 #define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL)
72 #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
73 #else
74 #define xstrdup(_str) strdup(_str)
75 #endif /* HAVE_MCHECK_H && defined(__GNUC__) */
78 #include "popt.h"