Commit 274a63d3 authored by Simon Morlat's avatar Simon Morlat
Browse files

repair build for linux/macos

parent 0974a663
......@@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "belle_sip_internal.h"
#include "belle-sip/uri.h"
#include "belle-sip/parameters.h"
#include <stdlib.h>
......@@ -24,6 +23,7 @@
#include <stdarg.h>
#include "belle_sip_messageParser.h"
#include "belle_sip_messageLexer.h"
#include "belle_sip_internal.h"
#include "listeningpoint_internal.h"
......
......@@ -520,7 +520,7 @@ char* _belle_sip_str_dup_and_unquote_string(const char* quoted_string) {
}
unsigned int belle_sip_random(void){
#if __linux || __APPLE__
#if defined(__linux) || defined(__APPLE__)
static int fd=-1;
if (fd==-1) fd=open("/dev/urandom",O_RDONLY);
if (fd!=-1){
......@@ -536,7 +536,9 @@ unsigned int belle_sip_random(void){
initd=1;
}
return rand()<<16 | rand();
#else
#endif
/*fallback to random()*/
#ifndef WIN32
return (unsigned int) random();
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment