~ubuntu-branches/ubuntu/precise/crtmpserver/precise-backports

« back to all changes in this revision

Viewing changes to common/include/platform/osx/osxplatform.h

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-07-04 00:04:40 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120704000440-u9x7yhyglqjvspk8
Tags: 1.0~dfsg-3~ubuntu12.04.1
No-change backport to precise (LP: #964153)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
#define GET_PROC_ADDRESS(libHandler, procName) dlsym((libHandler), (procName))
89
89
#define LIBRARY_NAME_PATTERN "lib%s.dylib"
90
90
#define PATH_SEPARATOR '/'
91
 
#define CLOSE_SOCKET(fd) close(fd)
 
91
#define CLOSE_SOCKET(fd) if((fd)>=0) close((fd))
92
92
#define InitNetworking()
93
93
#ifdef MAC_OS_X_VERSION_10_6
94
94
#define HAS_KQUEUE_TIMERS
105
105
#define Timestamp struct tm
106
106
#define Timestamp_init {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
107
107
 
108
 
#define CLOCKS_PER_SECOND 1000000L
 
108
#define CLOCKS_PER_SECOND CLOCKS_PER_SEC
109
109
#define GETCLOCKS(result) \
110
110
do { \
111
111
    struct timeval ___timer___; \
141
141
        uint8_t type;
142
142
} select_event;
143
143
 
 
144
#define MSGHDR struct msghdr
 
145
#define IOVEC iovec
 
146
#define MSGHDR_MSG_IOV msg_iov
 
147
#define MSGHDR_MSG_IOVLEN msg_iovlen
 
148
#define MSGHDR_MSG_NAME msg_name
 
149
#define MSGHDR_MSG_NAMELEN msg_namelen
 
150
#define IOVEC_IOV_BASE iov_base
 
151
#define IOVEC_IOV_LEN iov_len
 
152
#define IOVEC_IOV_BASE_TYPE uint8_t
 
153
#define SENDMSG(s,msg,flags,sent) sendmsg(s,msg,flags)
 
154
 
144
155
string format(string fmt, ...);
145
156
string vFormat(string fmt, va_list args);
146
157
void replace(string &target, string search, string replacement);
154
165
bool setFdKeepAlive(int32_t fd);
155
166
bool setFdNoNagle(int32_t fd);
156
167
bool setFdReuseAddress(int32_t fd);
157
 
bool setFdMulticastTTL(int32_t fd, uint8_t multicastTtl);
 
168
bool setFdTTL(int32_t fd, uint8_t ttl);
 
169
bool setFdMulticastTTL(int32_t fd, uint8_t ttl);
158
170
bool setFdTOS(int32_t fd, uint8_t tos);
159
171
bool setFdOptions(int32_t fd);
160
172
bool deleteFile(string path);
168
180
void lTrim(string &value);
169
181
void rTrim(string &value);
170
182
void trim(string &value);
 
183
int8_t getCPUCount();
171
184
map<string, string> mapping(string str, string separator1, string separator2, bool trimStrings);
172
185
void splitFileName(string fileName, string &name, string &extension, char separator = '.');
173
186
double getFileModificationDate(string path);