ap_config.h

原创 2006年06月04日 22:54:00

#ifdef __cplusplus
extern "C" {
#endif

/*
 * ap_config.h: system-dependant #defines and includes...
 * See PORTING for a listing of what they mean
 */

#include "ap_mmn.h"  /* MODULE_MAGIC_NUMBER_ */

/*
 * Support for platform dependent autogenerated defines
 */

#include "ap_config_auto.h"


/* Have to include sys/stat.h before ../os/win32/os.h so we can override
stat() properly */
#include <sys/types.h>
#include <sys/stat.h>


#include "os.h"


#include <sys/param.h>


/* Define one of these according to your system. */
#if defined(MINT)


#elif defined(MPE)


#elif defined(SUNOS4)


#elif defined(SOLARIS2)

#elif defined(IRIX)

 

#elif defined(HIUX)


#elif defined(HPUX) || defined(HPUX10)

#elif defined(HPUX11)


#elif defined(AIX)


#elif defined(ULTRIX)


#elif defined(OSF1)

#elif defined(PARAGON)


#elif defined(SEQUENT)


#elif defined(NEXT)

 


#elif defined(RHAPSODY) /* Mac OS X Server */

 

#elif defined(LINUX)

#if LINUX > 1
#include <features.h>

/* libc4 systems probably still work, it probably doesn't define
 *  __GNU_LIBRARY__
 * libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
 * glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
 * "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
 * glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
 * __GLIBC__ < 2
 * all glibc based systems need crypt.h
 */
 //this Macro __GNU_LIBRARY is defined in the features.h
#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <crypt.h>
#endif

/* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
 * there's no way to discern between these two libraries.  But using int should
 * be portable because otherwise these libs would be hopelessly broken with
 * reams of existing networking code.  We'll use socklen_t * for 2.1.x and
 * later.
 *
 * int works for all the earlier libs, and is picked up by default later.
 */
 // the macro __GLIBC__  is defined in the features.h
#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
#define NET_SIZE_T socklen_t
#endif

#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define HAVE_MMAP 1
#define USE_MMAP_FILES

/* glibc 2.1 and later finally define rlim_t */
#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
typedef int rlim_t;
#endif

/* flock is faster ... but hasn't been tested on 1.x systems */
#define USE_FLOCK_SERIALIZED_ACCEPT

#define SYS_SIGLIST _sys_siglist

#else   // according to if LINUX > 1
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif

#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#include <sys/time.h>
#define HAVE_SYSLOG 1

#elif defined(SCO)

#elif defined(SCO5)

 

#elif defined(AUX3)


#elif defined(SVR4)

 

#elif defined(UW)

#elif defined(DGUX)


#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)


#elif defined(UTS21)


#elif defined(APOLLO)


#elif defined(__FreeBSD__) || defined(__bsdi__)


#elif defined(QNX)


#elif defined(LYNXOS)


#elif defined(UXPDS)


#elif defined(OS2)


#elif defined(__MACHTEN__)


/* Convex OS v11 */
#elif defined(CONVEXOS11)

 


#elif defined(ISC)


#elif defined(NEWSOS)


#elif defined(RISCIX)

#elif defined(WIN32)

/* All windows stuff is now in os/win32/os.h */

#else

#endif

/* stuff marked API_EXPORT is part of the API, and intended for use
 * by modules
 */
#ifndef API_EXPORT
#define API_EXPORT(type)    type
#endif

/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
 * use by modules.  The difference between API_EXPORT and
 * API_EXPORT_NONSTD is that the latter is required for any functions
 * which use varargs or are used via indirect function call.  This
 * is to accomodate the two calling conventions in windows dlls.
 */
#ifndef API_EXPORT_NONSTD
#define API_EXPORT_NONSTD(type)    type
#endif

#ifndef MODULE_VAR_EXPORT
#define MODULE_VAR_EXPORT
#endif

#ifndef API_VAR_EXPORT
#define API_VAR_EXPORT
#endif

/* modules should not used functions marked CORE_EXPORT
 * or CORE_EXPORT_NONSTD */
#ifndef CORE_EXPORT
#define CORE_EXPORT API_EXPORT
#endif

#ifndef CORE_EXPORT_NONSTD
#define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
#endif

/* On OpenStep and Rhapsody, symbols that conflict with loaded dylibs
 * (eg. System framework) need to be declared as private symbols with
 * __private_extern__.
 * For other systems, make that a no-op.
 */

#define ap_private_extern


/* So that we can use inline on some critical functions, and use
 * GNUC attributes (such as to get -Wall warnings for printf-like
 * functions).  Only do this in gcc 2.7 or later ... it may work
 * on earlier stuff, but why chance it.
 *
 * We've since discovered that the gcc shipped with NeXT systems
 * as "cc" is completely broken.  It claims to be __GNUC__ and so
 * on, but it doesn't implement half of the things that __GNUC__
 * means.  In particular it's missing inline and the __attribute__
 * stuff.  So we hack around it.  PR#1613. -djg
 */


#define ap_inline __inline__
#define USE_GNU_INLINE
#define ENUM_BITFIELD(e,n,w)  e n : w


/*
 * The particular directory style your system supports. If you have dirent.h
 * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
 * that file and define DIR_TYPE to be dirent. Otherwise, if you have
 * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
 * file. If you have neither, I'm confused.
 */

#include <sys/types.h>
#include <stdarg.h>


#include <dirent.h>
#define DIR_TYPE dirent


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ap_ctype.h"

#include <sys/file.h>

#ifndef WIN32
#include <sys/socket.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>

#include <arpa/inet.h>  /* for inet_ntoa */

#include <sys/wait.h>
#include <pwd.h>
#include <grp.h>
#include <fcntl.h>
#include <limits.h>
#define closesocket(s) close(s)

#define O_BINARY (0)


#else /* WIN32 */
#include <winsock.h>
#include <malloc.h>
#include <io.h>
#include <fcntl.h>
#endif /* ndef WIN32 */

 

 


#include <time.h>  /* for ctime */
#include <signal.h>
#include <errno.h>

#include <memory.h>


#ifdef NEED_PROCESS_H
#include <process.h>
#endif


#include "hsregex.h"

 

#include <sys/resource.h>

 

#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
#define MAP_ANON MAP_ANONYMOUS
#endif

#if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_FILES
#endif

#if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_SCOREBOARD
#endif

#if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
#undef USE_SHMGET_SCOREBOARD
#endif

#ifndef LOGNAME_MAX
#define LOGNAME_MAX 25
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

 

#ifndef S_ISLNK
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif

#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned long) -1)
#endif

/*
 * Replace signal function with sigaction equivalent
 */
#ifndef NO_USE_SIGACTION
typedef void Sigfunc(int);

#if defined(SIG_IGN) && !defined(SIG_ERR)
#define SIG_ERR ((Sigfunc *)-1)
#endif

/*
 * For some strange reason, QNX defines signal to signal. Eliminate it.
 */
#ifdef signal
#undef signal
#endif
#define signal(s,f) ap_signal(s,f)
Sigfunc *signal(int signo, Sigfunc * func);
#endif

#include <setjmp.h>

#if defined(USE_LONGJMP)
#define ap_longjmp(x, y)        longjmp((x), (y))
#define ap_setjmp(x)            setjmp(x)
#ifndef JMP_BUF
#define JMP_BUF jmp_buf
#endif
#else
#define ap_longjmp(x, y)        siglongjmp((x), (y))
#define ap_setjmp(x)            sigsetjmp((x), 1)
#ifndef JMP_BUF
#define JMP_BUF sigjmp_buf
#endif
#endif


#define ap_select select

 

#define ap_fdopen(d,m) fdopen((d), (m))


#ifndef ap_inet_addr
#define ap_inet_addr inet_addr
#endif

 


/* Finding offsets of elements within structures.
 * Taken from the X code... they've sweated portability of this stuff
 * so we don't have to.  Sigh...
 */

 

#define XtOffset(p_type,field) /
 ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))

 


#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)


/*
 * NET_SIZE_T exists because of shortsightedness on the POSIX committee.  BSD
 * systems used "int *" as the parameter to accept(), getsockname(),
 * getpeername() et al.  Consequently many unixes took an int * for that
 * parameter.  The POSIX committee decided that "int" was just too generic and
 * had to be replaced with size_t almost everywhere.  There's no problem with
 * that when you're passing by value.  But when you're passing by reference
 * this creates a gross source incompatibility with existing programs.  On
 * 32-bit architectures it creates only a warning.  On 64-bit architectures it
 * creates broken code -- because "int *" is a pointer to a 64-bit quantity and
 * "size_t *" is frequently a pointer to a 32-bit quantity.
 *
 * Some Unixes adopted "size_t *" for the sake of POSIX compliance.  Others
 * ignored it because it was such a broken interface.  Chaos ensued.  POSIX
 * finally woke up and decided that it was wrong and created a new type
 * socklen_t.  The only useful value for socklen_t is int, and that's how
 * everyone who has a clue implements it.  It is almost always the case that
 * NET_SIZE_T should be defined to be an int, unless the system being compiled
 * for was created in the window of POSIX madness.
 */
#ifndef NET_SIZE_T
#define NET_SIZE_T int
#endif

/* Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
 * is in use... we'd prefer to just use WCOREDUMP everywhere.
 */
#if defined(__WCOREDUMP) && !defined(WCOREDUMP)
#define WCOREDUMP __WCOREDUMP
#endif

 

 

 

 


#ifndef ap_wait_t
#define ap_wait_t int
#endif

#ifdef __cplusplus
}
#endif

#endif /* !AP_CONFIG_H */

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

config.w32.h

H3CWA1205E-AP

  • 2013-09-29 10:47
  • 586KB
  • 下载

freetype/config/ftheader.h: No such file or directory

今天在linux编译工程时,碰到如下错误: /opt/mv_pro_4.0.1/montavista/pro/devkit/arm/v5t_le/bin/../target/usr/includ...

《STL源码剖析》—— stl_config.h

参考侯捷《STL源码剖析》 #ifndef __STL_CONFIG_H # define __STL_CONFIG_H // 本文件所做的事情: // (1) 如果编译器没有定义 bool,t...
  • bolike
  • bolike
  • 2014-02-12 22:26
  • 1193

VxWorks BSP主要配置文件 config.h , Makefile 注解和 BSP生成下载实例

原文出处: http://www.embhelp.com/drew/mypage/example/config.htm#config config.h /* This file con...

vxworks的 config.h注释

/* This file contains the configuration parameters for the CPU evaluation board. */ #ifndef INC...

C++ STL源码剖析-- stl_config.h

// Filename: stl_config.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com // Blog: ...

《STL源码剖析》-- stl_config.h

《STL源码剖析》-- stl_config.h
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)