1/* 2 * Copyright (c) 2010 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. Neither the name of Apple Inc. ("Apple") nor the names of its 16 * contributors may be used to endorse or promote products derived from 17 * this software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * 30 * Portions of this software have been released under the following terms: 31 * 32 * (c) Copyright 1989-1993 OPEN SOFTWARE FOUNDATION, INC. 33 * (c) Copyright 1989-1993 HEWLETT-PACKARD COMPANY 34 * (c) Copyright 1989-1993 DIGITAL EQUIPMENT CORPORATION 35 * 36 * To anyone who acknowledges that this file is provided "AS IS" 37 * without any express or implied warranty: 38 * permission to use, copy, modify, and distribute this file for any 39 * purpose is hereby granted without fee, provided that the above 40 * copyright notices and this notice appears in all source code copies, 41 * and that none of the names of Open Software Foundation, Inc., Hewlett- 42 * Packard Company or Digital Equipment Corporation be used 43 * in advertising or publicity pertaining to distribution of the software 44 * without specific, written prior permission. Neither Open Software 45 * Foundation, Inc., Hewlett-Packard Company nor Digital 46 * Equipment Corporation makes any representations about the suitability 47 * of this software for any purpose. 48 * 49 * Copyright (c) 2007, Novell, Inc. All rights reserved. 50 * Redistribution and use in source and binary forms, with or without 51 * modification, are permitted provided that the following conditions 52 * are met: 53 * 54 * 1. Redistributions of source code must retain the above copyright 55 * notice, this list of conditions and the following disclaimer. 56 * 2. Redistributions in binary form must reproduce the above copyright 57 * notice, this list of conditions and the following disclaimer in the 58 * documentation and/or other materials provided with the distribution. 59 * 3. Neither the name of Novell Inc. nor the names of its contributors 60 * may be used to endorse or promote products derived from this 61 * this software without specific prior written permission. 62 * 63 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 64 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 65 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 66 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY 67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 68 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 69 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 70 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 71 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 72 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 73 * 74 * @APPLE_LICENSE_HEADER_END@ 75 */ 76 77/* 78 * OSF DCE Version 1.0 79 */ 80 81#ifndef sysdep_incl 82#define sysdep_incl 83 84/* 85** 86** NAME 87** 88** SYSDEP.H 89** 90** FACILITY: 91** 92** Interface Definition Language (IDL) Compiler 93** 94** ABSTRACT: 95** 96** Operating system and compiler dependencies. 97** 98** VERSION: DCE 1.0 99** 100*/ 101 102/* 103 * exit status codes 104 */ 105# define pgm_ok 0 106# define pgm_warning 2 107# define pgm_error 3 108 109/* 110** Macro to test a system-specific status code for failure status. 111*/ 112#define ERROR_STATUS(s) ((s) != 0) 113 114/* 115** define HASDIRTREE if OS has foo/widget/bar file system. 116** if HASDIRTREE, define BRANCHCHAR and BRANCHSTRING appropriately 117** define HASPOPEN if system can do popen() 118** define HASINODES if system has real inodes returned by stat() 119*/ 120 121#if defined(__OSF__) || defined(__OSF1__) || defined(__osf__) || defined(BSD) || defined(SYS5) || defined(ultrix) || defined(_AIX) || defined(__ultrix) || defined(_BSD) || defined(__linux__) 122#define UNIX 123#define HASDIRTREE 124#define HASPOPEN 125#define HASINODES 126#define BRANCHCHAR '/' 127#define BRANCHSTRING "/" 128#define CD_IDIR "." 129#endif 130 131#ifndef CD_IDIR 132Porting Message: You must provide definitions for the symbols 133 describing the directory structure available on your platform. 134#endif 135 136/* 137 * Default DCE include directory 138 */ 139#ifndef DEFAULT_IDIR 140# define DEFAULT_IDIR "/usr/include" 141#endif 142#define DEFAULT_H_IDIR DEFAULT_IDIR 143#define INCLUDE_TEMPLATE "#include <dce/%s>\n" 144#define USER_INCLUDE_TEMPLATE "#include <%s>\n" 145#define USER_INCLUDE_H_TEMPLATE "#include <%s.h>\n" 146 147/* 148 * Default DCE auto import path 149 */ 150#ifndef AUTO_IMPORT_FILE 151# define AUTO_IMPORT_FILE "dce/nbase.idl" 152#endif 153 154/* 155** Default filetype names. 156*/ 157#define OBJ_FILETYPE ".o" 158 159/* 160** Commands to invoke C-Preprocessor, C-Compiler etc. 161*/ 162#define CPP "/usr/bin/xcrun cc -E -x c-header " 163#define CC_DEF_CMD "/usr/bin/xcrun cc -c -D_SOCKADDR_LEN -D_GNU_SOURCE -D_REENTRANT -D_POSIX_C_SOURCE=3" 164 165/* 166** Default suffixes for IDL-generated files. 167*/ 168#ifdef UNIX 169# if ENABLE_DCOM 170# define CSTUB_SUFFIX "_cstub.cxx" 171# define SSTUB_SUFFIX "_sstub.cxx" 172# define SAUX_SUFFIX "_saux.cxx" 173# define CAUX_SUFFIX "_caux.cxx" 174# else 175# define CSTUB_SUFFIX "_cstub.c" 176# define SSTUB_SUFFIX "_sstub.c" 177# define CAUX_SUFFIX "_caux.c" 178# define SAUX_SUFFIX "_saux.c" 179# endif 180# define HEADER_SUFFIX ".h" 181#endif 182 183#ifndef CSTUB_SUFFIX 184Porting Message: You must provide definitions for the files suffixes to 185 be used on your platform. 186#endif 187 188/* 189 * Template for IDL version text emitted as comment into generated files. 190 */ 191#ifndef IDL_VERSION_TEXT 192# if ENABLE_DCOM 193# define IDL_VERSION_TEXT "FreeDCE/DCOM " VERSION " with GNU Flex/Bison" 194# else 195# define IDL_VERSION_TEXT "FreeDCE " VERSION " with GNU Flex/Bison" 196# endif 197#endif 198#define IDL_VERSION_TEMPLATE "/* Generated by IDL compiler version %s */\n" 199 200/* 201** PASS_I_DIRS_TO_CC determines whether the list of import directories, with 202** the system IDL directory replaced by the system H directory if present, 203** gets passed as command option(s) to the C compiler when compiling stubs. 204*/ 205#ifndef apollo 206# define PASS_I_DIRS_TO_CC 207#endif 208 209/* 210** Environment variables for IDL system include directories 211** on supported platforms. 212*/ 213#ifdef DUMPERS 214# define NIDL_LIBRARY_EV "NIDL_LIBRARY" 215#endif 216 217/* 218** Maximum length of IDL identifiers. Architecturally specified as 31, but 219** on platforms whose C (or other) compilers have more stringent lengths, 220** this value might have to be less. 221*/ 222#define MAX_ID 128 223 224/* 225** Estimation of available stack size in a server stub. Under DCE threads 226** stack overflow by large amounts can result in indeterminant behavior. If 227** the estimated stack requirements for stack surrogates exceeds the value 228** below, objects are allocated via malloc instead of on the stack. 229*/ 230#define AUTO_HEAP_STACK_THRESHOLD 7000 231 232/* 233** Symbol for 'audible bell' character. A workaround for the problem that 234** some non-stdc compilers incorrectly map '\a' to 'a'. Might need work 235** on a non-stdc EBCDIC platform. 236*/ 237#if defined(__STDC__) 238#define AUDIBLE_BELL '\a' 239#define AUDIBLE_BELL_CSTR "\\a" 240#else 241#define AUDIBLE_BELL '\007' 242#define AUDIBLE_BELL_CSTR "\\007" 243#endif 244 245/* 246** Data type of memory returned by malloc. In ANSI standard compilers, this 247** is a void *, but default to char * for others. 248*/ 249#if defined(__STDC__) || defined(vaxc) 250#define heap_mem void 251#else 252#define heap_mem char 253#endif 254 255/* 256** Maximum number of characters in a directory path name for a file. Used 257** to allocate buffer space for manipulating the path name string. 258*/ 259#ifndef PATH_MAX 260# define PATH_MAX 1024 261#endif 262 263/* 264** Define macros for NLS entry points used only in message.c 265*/ 266#if defined(_AIX) 267# define NL_SPRINTF NLsprintf 268# define NL_VFPRINTF NLvfprintf 269#else 270# define NL_SPRINTF sprintf 271# define NL_VFPRINTF vfprintf 272#endif 273 274#ifndef HAVE_STRLCAT 275size_t strlcat(char *, const char *, size_t); 276#endif 277 278#ifndef HAVE_STRLCPY 279size_t strlcpy(char *, const char *, size_t); 280#endif 281 282#endif /* sysdep_incl */ 283