Debian Codegraph @

include/public/base/systems.h

raw
1 /** BEGIN COPYRIGHT BLOCK
2 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
3 * Copyright (C) 2005 Red Hat, Inc.
4 * All rights reserved.
5 *
6 * License: GPL (version 3 or any later version).
7 * See LICENSE for details.
8 * END COPYRIGHT BLOCK **/
9
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13
14 #ifndef PUBLIC_BASE_SYSTEMS_H
15 #define PUBLIC_BASE_SYSTEMS_H
16
17 /*
18 * File: systems.h
19 *
20 * Description:
21 *
22 * This file defines various platform-dependent symbols, which are
23 * used to configure platform-dependent aspects of the API.
24 */
25
26 /* --- Begin native platform configuration definitions --- */
27
28 #if defined(HPUX)
29
30 #define FILE_UNIX
31 #define FILE_UNIX_MMAP
32 #define MALLOC_POOLS
33 #define SEM_FLOCK
34 /* warning: mmap doesn't work under 9.04 */
35 #define SHMEM_UNIX_MMAP
36 #define ZERO(ptr, len) memset(ptr, 0, len)
37
38 #elif defined(SOLARIS) || defined(SOLARISx86)
39
40 #undef FILE_UNIX /* avoid redefinition message */
41 #define FILE_UNIX
42 #define FILE_UNIX_MMAP
43 #define MALLOC_POOLS
44 /* The Solaris routines return ENOSPC when too many semaphores are SEM_UNDO. */
45 #define SEM_FLOCK
46 #define SHMEM_UNIX_MMAP
47 #define ZERO(ptr, len) memset(ptr, 0, len)
48
49 #elif defined(SUNOS4)
50
51 #define BSD_FLOCK
52 #define FILE_UNIX
53 #define FILE_UNIX_MMAP
54 #define MALLOC_POOLS
55 #define SEM_FLOCK
56 #define SHMEM_UNIX_MMAP
57 #define ZERO(ptr, len) memset(ptr, 0, len)
58
59 #elif defined(LINUX)
60
61 #define FILE_UNIX
62 #define FILE_UNIX_MMAP
63 #define MALLOC_POOLS
64 #define SEM_FLOCK
65 #define SHMEM_UNIX_MMAP
66 #define ZERO(ptr, len) memset(ptr, 0, len)
67
68 #elif defined(__FreeBSD__)
69
70 #define FILE_UNIX
71 #define FILE_UNIX_MMAP
72 #define MALLOC_POOLS
73 #define SEM_FLOCK
74 #define SHMEM_UNIX_MMAP
75 #define ZERO(ptr, len) memset(ptr, 0, len)
76
77 #else
78 #error "Missing defines in ns/netsite/include/public/base/systems.h"
79 #endif
80
81 #ifndef NSPR_BEGIN_EXTERN_C
82 #ifdef __cplusplus
83 #define NSPR_BEGIN_EXTERN_C extern "C" {
84 #define NSPR_END_EXTERN_C }
85 #else
86 #define NSPR_BEGIN_EXTERN_C
87 #define NSPR_END_EXTERN_C
88 #endif /* __cplusplus */
89 #endif /* !NSPR_BEGIN_EXTERN_C */
90
91 #ifndef NSAPI_PUBLIC
92 #define NSAPI_PUBLIC
93 #endif /* !NSAPI_PUBLIC */
94
95 #if defined(NEED_STRCASECMP) || defined(NEED_STRNCASECMP)
96 #ifndef CASECMPARG_T
97 #define CASECMPARG_T const
98 #endif /* !CASECMPARG_T */
99 #endif /* NEED_STRCASECMP || NEED_STRNCASECMP */
100
101 #endif /* PUBLIC_BASE_SYSTEMS_H */