Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
f48167fa
Commit
f48167fa
authored
Apr 07, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add defines for iOS and Android
parent
5e55e81a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
14 deletions
+21
-14
libcaf_core/caf/config.hpp
libcaf_core/caf/config.hpp
+14
-7
libcaf_core/caf/scheduler/profiled_coordinator.hpp
libcaf_core/caf/scheduler/profiled_coordinator.hpp
+3
-3
libcaf_core/src/get_mac_addresses.cpp
libcaf_core/src/get_mac_addresses.cpp
+2
-2
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+2
-2
No files found.
libcaf_core/caf/config.hpp
View file @
f48167fa
...
@@ -131,16 +131,23 @@
...
@@ -131,16 +131,23 @@
// - CAF_WINDOWS
// - CAF_WINDOWS
// It also defines CAF_POSIX for POSIX-compatible systems
// It also defines CAF_POSIX for POSIX-compatible systems
#if defined(__APPLE__)
#if defined(__APPLE__)
# define CAF_MACOS
# include "TargetConditionals.h"
# ifndef _GLIBCXX_HAS_GTHREADS
# if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
# define _GLIBCXX_HAS_GTHREADS
# define CAF_IOS
# else
# define CAF_MACOS
# ifndef _GLIBCXX_HAS_GTHREADS
# define _GLIBCXX_HAS_GTHREADS
# endif
# endif
# endif
#elif defined(__ANDROID__)
# define CAF_ANDROID
#elif defined(__linux__)
#elif defined(__linux__)
# define CAF_LINUX
# define CAF_LINUX
#
include <linux/version.h>
# include <linux/version.h>
#
if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
# if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
# define CAF_POLL_IMPL
#
define CAF_POLL_IMPL
#
endif
# endif
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
# define CAF_BSD
# define CAF_BSD
#elif defined(WIN32) || defined(_WIN32)
#elif defined(WIN32) || defined(_WIN32)
...
...
libcaf_core/caf/scheduler/profiled_coordinator.hpp
View file @
f48167fa
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "caf/config.hpp"
#include "caf/config.hpp"
#if
def CAF_MACOS
#if
defined(CAF_MACOS) || defined(CAF_IOS)
#include <mach/mach.h>
#include <mach/mach.h>
#else
#else
#include <sys/resource.h>
#include <sys/resource.h>
...
@@ -58,7 +58,7 @@ class profiled_coordinator : public coordinator<Policy> {
...
@@ -58,7 +58,7 @@ class profiled_coordinator : public coordinator<Policy> {
class
measurement
{
class
measurement
{
public:
public:
# if
def CAF_MACOS
# if
defined(CAF_MACOS) || defined(CAF_IOS)
static
usec
to_usec
(
const
::
time_value_t
&
tv
)
{
static
usec
to_usec
(
const
::
time_value_t
&
tv
)
{
return
std
::
chrono
::
seconds
(
tv
.
seconds
)
+
usec
(
tv
.
microseconds
);
return
std
::
chrono
::
seconds
(
tv
.
seconds
)
+
usec
(
tv
.
microseconds
);
}
}
...
@@ -72,7 +72,7 @@ class profiled_coordinator : public coordinator<Policy> {
...
@@ -72,7 +72,7 @@ class profiled_coordinator : public coordinator<Policy> {
auto
now
=
clock_type
::
now
().
time_since_epoch
();
auto
now
=
clock_type
::
now
().
time_since_epoch
();
measurement
m
;
measurement
m
;
m
.
time
=
std
::
chrono
::
duration_cast
<
usec
>
(
now
);
m
.
time
=
std
::
chrono
::
duration_cast
<
usec
>
(
now
);
# if
def CAF_MACOS
# if
defined(CAF_MACOS) || defined(CAF_IOS)
auto
tself
=
::
mach_thread_self
();
auto
tself
=
::
mach_thread_self
();
::
thread_basic_info
info
;
::
thread_basic_info
info
;
auto
count
=
THREAD_BASIC_INFO_COUNT
;
auto
count
=
THREAD_BASIC_INFO_COUNT
;
...
...
libcaf_core/src/get_mac_addresses.cpp
View file @
f48167fa
#include "caf/config.hpp"
#include "caf/config.hpp"
#include "caf/detail/get_mac_addresses.hpp"
#include "caf/detail/get_mac_addresses.hpp"
#if defined(CAF_MACOS) || defined(CAF_BSD)
#if defined(CAF_MACOS) || defined(CAF_BSD)
|| defined(CAF_IOS)
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
...
@@ -76,7 +76,7 @@ std::vector<iface_info> get_mac_addresses() {
...
@@ -76,7 +76,7 @@ std::vector<iface_info> get_mac_addresses() {
}
// namespace detail
}
// namespace detail
}
// namespace caf
}
// namespace caf
#elif defined(CAF_LINUX)
#elif defined(CAF_LINUX)
|| defined(CAF_ANDROID)
#include <vector>
#include <vector>
#include <string>
#include <string>
...
...
libcaf_io/src/default_multiplexer.cpp
View file @
f48167fa
...
@@ -50,11 +50,11 @@ using std::string;
...
@@ -50,11 +50,11 @@ using std::string;
namespace
{
namespace
{
#if
def CAF_MACOS
#if
defined(CAF_MACOS) || defined(CAF_IOS)
constexpr
int
no_sigpipe_flag
=
SO_NOSIGPIPE
;
constexpr
int
no_sigpipe_flag
=
SO_NOSIGPIPE
;
#elif defined(CAF_WINDOWS)
#elif defined(CAF_WINDOWS)
constexpr
int
no_sigpipe_flag
=
0
;
// does not exist on Windows
constexpr
int
no_sigpipe_flag
=
0
;
// does not exist on Windows
#else // BSD
or Linux
#else // BSD
, Linux or Android
constexpr
int
no_sigpipe_flag
=
MSG_NOSIGNAL
;
constexpr
int
no_sigpipe_flag
=
MSG_NOSIGNAL
;
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment