// ---------------------------------------------------------------------------
// - csys.hxx                                                                -
// - standard system library - c system function platform definitions        -
// ---------------------------------------------------------------------------
// - This program is free software;  you can redistribute it  and/or  modify -
// - it provided that this copyright notice is kept intact.                  -
// -                                                                         -
// - This program  is  distributed in  the hope  that it will be useful, but -
// - without  any  warranty;  without  even   the   implied    warranty   of -
// - merchantability or fitness for a particular purpose.  In no event shall -
// - the copyright holder be liable for any  direct, indirect, incidental or -
// - special damages arising in any way out of the use of this software.     -
// ---------------------------------------------------------------------------
// - copyright (c) 1999-2007 amaury darsch                                   -
// ---------------------------------------------------------------------------

// check for unknown platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_UNKNOWN)
#error "unknown platform type"
#endif

// check for unknown processor
#if (AFNIX_PLATFORM_PROCID == AFNIX_PROCTYPE_UNKNOWN)
#error "unknown processor type"
#endif

// linux platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_LINUX)
#ifndef  _GNU_SOURCE
#define  _GNU_SOURCE
#endif
#define  AFNIX_PLATFORM_TYPE "unix"
#define  AFNIX_PLATFORM_OSEP '-'
#define  AFNIX_HAVE_HOSTNAME
#define  AFNIX_HAVE_UID
#define  AFNIX_HAVE_BACKTRACE
#include <sys/types.h>
#include <pwd.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#endif

// solaris platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_SOLARIS)
#define  AFNIX_PLATFORM_TYPE "unix"
#define  AFNIX_PLATFORM_OSEP '-'
#define  AFNIX_HAVE_SYSINFO
#define  AFNIX_HAVE_UID
#include <sys/systeminfo.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#include <pwd.h>
#endif

// freebsd platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_FREEBSD)
#define  AFNIX_PLATFORM_TYPE "unix"
#define  AFNIX_PLATFORM_OSEP '-'
#define  AFNIX_HAVE_HOSTNAME
#define  AFNIX_HAVE_UID
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#include <pwd.h>
#endif

// darwin platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_DARWIN)
#define  AFNIX_PLATFORM_TYPE "darwin"
#define  AFNIX_PLATFORM_OSEP '-'
#define  AFNIX_HAVE_HOSTNAME
#define  AFNIX_HAVE_UID
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#include <pwd.h>
#endif

// gnu/freebsd platform
#if (AFNIX_PLATFORM_PLATID == AFNIX_PLATFORM_GNUKBSD)
#ifndef  _GNU_SOURCE
#define  _GNU_SOURCE
#endif
#define  AFNIX_PLATFORM_TYPE "unix"
#define  AFNIX_PLATFORM_OSEP '-'
#define  AFNIX_HAVE_HOSTNAME
#define  AFNIX_HAVE_UID
#define  AFNIX_HAVE_BACKTRACE
#include <sys/types.h>
#include <pwd.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#endif


syntax highlighted by Code2HTML, v. 0.9.1