aboutsummaryrefslogtreecommitdiff
path: root/src/compat/osx.h
blob: 19628a36ecbe1e58ada99706ef00c2bbe2f5bb61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
 *
 * This file is part of the libbu++ library and is released under the
 * terms of the license contained in the file LICENSE.
 */

#ifndef OSX_COMPATIBILITY__H
#define OSX_COMPATIBILITY__H

#ifdef __APPLE__

#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(expression)            \
  (__extension__                                  \
    ({ long int __result;                         \
      do __result = (long int) (expression);      \
      while (__result == -1L && errno == EINTR);  \
      __result; }))
#endif

#include <sched.h>

#define pthread_yield() sched_yield()
#endif /* __APPLE__ */
#endif