blob: df54511112f719b1d71362fa6db9ff183ddf7c5c [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (C) Copyright John Maddock 2001 - 2003.
2// (C) Copyright Darin Adler 2001.
3// (C) Copyright Douglas Gregor 2002.
4// Use, modification and distribution are subject to the
5// Boost Software License, Version 1.0. (See accompanying file
6// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8// See http://www.boost.org for most recent version.
9
10// generic BSD config options:
11
12#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
13#error "This platform is not BSD"
14#endif
15
16#ifdef __FreeBSD__
Jeff Thompson3d613fd2013-10-15 15:39:04 -070017#define NDNBOOST_PLATFORM "FreeBSD " NDNBOOST_STRINGIZE(__FreeBSD__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070018#elif defined(__NetBSD__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070019#define NDNBOOST_PLATFORM "NetBSD " NDNBOOST_STRINGIZE(__NetBSD__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070020#elif defined(__OpenBSD__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070021#define NDNBOOST_PLATFORM "OpenBSD " NDNBOOST_STRINGIZE(__OpenBSD__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070022#elif defined(__DragonFly__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070023#define NDNBOOST_PLATFORM "DragonFly " NDNBOOST_STRINGIZE(__DragonFly__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024#endif
25
26//
27// is this the correct version check?
28// FreeBSD has <nl_types.h> but does not
29// advertise the fact in <unistd.h>:
30//
31#if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) || defined(__DragonFly__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070032# define NDNBOOST_HAS_NL_TYPES_H
Jeff Thompsonf7d49942013-08-01 16:47:40 -070033#endif
34
35//
36// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
37// and not in <unistd.h>
38//
39#if (defined(__FreeBSD__) && (__FreeBSD__ <= 3))\
40 || defined(__OpenBSD__) || defined(__DragonFly__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070041# define NDNBOOST_HAS_PTHREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070042#endif
43
44//
45// No wide character support in the BSD header files:
46//
47#if defined(__NetBSD__)
48#define __NetBSD_GCC__ (__GNUC__ * 1000000 \
49 + __GNUC_MINOR__ * 1000 \
50 + __GNUC_PATCHLEVEL__)
51// XXX - the following is required until c++config.h
52// defines _GLIBCXX_HAVE_SWPRINTF and friends
53// or the preprocessor conditionals are removed
54// from the cwchar header.
55#define _GLIBCXX_HAVE_SWPRINTF 1
56#endif
57
58#if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
59 || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070060# define NDNBOOST_NO_CWCHAR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070061#endif
62//
63// The BSD <ctype.h> has macros only, no functions:
64//
65#if !defined(__OpenBSD__) || defined(__DragonFly__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070066# define NDNBOOST_NO_CTYPE_FUNCTIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070067#endif
68
69//
70// thread API's not auto detected:
71//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072#define NDNBOOST_HAS_SCHED_YIELD
73#define NDNBOOST_HAS_NANOSLEEP
74#define NDNBOOST_HAS_GETTIMEOFDAY
75#define NDNBOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
76#define NDNBOOST_HAS_SIGACTION
Jeff Thompsonf7d49942013-08-01 16:47:40 -070077
78// boilerplate code:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070079#define NDNBOOST_HAS_UNISTD_H
Jeff Thompson2277ce52013-08-01 17:34:11 -070080#include <ndnboost/config/posix_features.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070081
82
83
84
85
86