Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
e57c1182
Commit
e57c1182
authored
Jan 15, 2013
by
Simon Morlat
Browse files
start porting on win32
parent
d68cfb8c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
27 deletions
+74
-27
README
README
+15
-0
autogen.sh
autogen.sh
+4
-0
configure.ac
configure.ac
+10
-6
include/belle-sip/mainloop.h
include/belle-sip/mainloop.h
+0
-4
src/belle_sip_internal.h
src/belle_sip_internal.h
+15
-4
src/belle_sip_object.c
src/belle_sip_object.c
+12
-0
src/belle_sip_resolver.h
src/belle_sip_resolver.h
+0
-6
src/belle_sip_uri_impl.c
src/belle_sip_uri_impl.c
+1
-1
src/belle_sip_utils.c
src/belle_sip_utils.c
+17
-6
No files found.
README
View file @
e57c1182
Dependencies:
libantlr3c-3.2
antlr3-3.2
Newer versions won't compile.
On windows you have to edit /usr/local/include/antl3defs.h
replace:
#include <winsock.h>
by:
#include <winsock2.h>
autogen.sh
View file @
e57c1182
...
...
@@ -19,6 +19,10 @@ if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS
=
"-I /opt/local/share/aclocal"
fi
if
test
-d
/share/aclocal
;
then
ACLOCAL_ARGS
=
"-I /share/aclocal"
fi
echo
"Generating build scripts in belle-sip..."
set
-x
$LIBTOOLIZE
--copy
--force
...
...
configure.ac
View file @
e57c1182
...
...
@@ -37,12 +37,13 @@ else
CFLAGS="-g"
fi
STRICT_OPTIONS=" -Wall -Werror"
STRICT_OPTIONS=" -Wall -Werror
-Wno-error=unknown-pragmas
"
dnl because of antlr3 we must accept a few warnings...
LESS_STRICT_OPTIONS= #more portable
# LESS_STRICT_OPTIONS="$STRICT_OPTIONS -Wno-error=unused-function \
# -Wno-error=uninitialized -Wno-error=unused-variable \
# -Wno-error=unused-but-set-variable "
dnl more portable for the moment
LESS_STRICT_OPTIONS=
dnl LESS_STRICT_OPTIONS="$STRICT_OPTIONS -Wno-error=unused-function \
dnl -Wno-error=uninitialized -Wno-error=unused-variable \
dnl -Wno-error=unused-but-set-variable "
AC_SUBST(STRICT_OPTIONS)
AC_SUBST(LESS_STRICT_OPTIONS)
...
...
@@ -51,7 +52,7 @@ AC_SUBST(LESS_STRICT_OPTIONS)
# Checks for header files.
AC_ARG_WITH( antlr,
[ --with-antlr Set prefix where libantlr can be found
or "none" to disable
(ex:/usr or /usr/local)[default=/usr] ],
[ --with-antlr Set prefix where libantlr
3c
can be found (ex:/usr or /usr/local)[default=/usr] ],
[ antlr_prefix=${withval}],[ antlr_prefix=/usr ])
found_antlr3=no
...
...
@@ -131,6 +132,9 @@ case "$target_os" in
#hack for macport
CUNIT_LIBS+=" -lncurses"
;;
*mingw*)
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0501"
;;
esac
if test "$found_cunit" = "no" ; then
...
...
include/belle-sip/mainloop.h
View file @
e57c1182
...
...
@@ -18,10 +18,6 @@
#ifndef BELLE_SIP_MAINLOOP_H
#define BELLE_SIP_MAINLOOP_H
#include <errno.h>
#include <sys/socket.h>
#include <unistd.h>
#define BELLE_SIP_EVENT_READ 1
...
...
src/belle_sip_internal.h
View file @
e57c1182
...
...
@@ -20,16 +20,27 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <s
tdint
.h>
#include <s
ys/types
.h>
#include <errno.h>
#include <unistd.h>
#ifndef WIN32
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <pthread.h>
#else
#include <ws2tcpip.h>
#include <winsock2.h>
#include <pthread.h>
#endif
/* include all public headers*/
...
...
src/belle_sip_object.c
View file @
e57c1182
...
...
@@ -329,6 +329,8 @@ char *belle_sip_object_describe(void *obj){
return
_belle_sip_object_describe_type
(
o
->
vptr
);
}
#if !defined(WIN32)
#include <dlfcn.h>
char
*
belle_sip_object_describe_type_from_name
(
const
char
*
name
){
...
...
@@ -351,3 +353,13 @@ char *belle_sip_object_describe_type_from_name(const char *name){
}
return
_belle_sip_object_describe_type
((
belle_sip_object_vptr_t
*
)
symbol
);
}
#else
char
*
belle_sip_object_describe_type_from_name
(
const
char
*
name
){
return
belle_sip_strdup_printf
(
"Sorry belle_sip_object_describe_type_from_name() is not implemented on this platform."
);
}
#endif
src/belle_sip_resolver.h
View file @
e57c1182
...
...
@@ -22,12 +22,6 @@
#include "belle_sip_internal.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <pthread.h>
#define BELLE_SIP_RESOLVER_HINT_IPV6 (1)
#define BELLE_SIP_RESOLVER_HINT_SRV (1<<1)
...
...
src/belle_sip_uri_impl.c
View file @
e57c1182
...
...
@@ -16,6 +16,7 @@
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>
...
...
@@ -23,7 +24,6 @@
#include <stdarg.h>
#include "belle_sip_messageParser.h"
#include "belle_sip_messageLexer.h"
#include "belle_sip_internal.h"
#include "listeningpoint_internal.h"
...
...
src/belle_sip_utils.c
View file @
e57c1182
...
...
@@ -117,9 +117,7 @@ void belle_sip_logv(int level, const char *fmt, va_list args)
{
if
(
belle_sip_logv_out
!=
NULL
&&
belle_sip_log_level_enabled
(
level
))
belle_sip_logv_out
(
level
,
fmt
,
args
);
#if !defined(_WIN32_WCE)
if
((
level
)
==
BELLE_SIP_FATAL
)
abort
();
#endif
if
((
level
)
==
BELLE_SIP_LOG_FATAL
)
abort
();
}
#endif
...
...
@@ -470,6 +468,7 @@ char * belle_sip_strdup(const char *s){
return
strdup
(
s
);
}
#ifndef WIN32
uint64_t
belle_sip_time_ms
(
void
){
struct
timespec
ts
;
static
int
clock_id
=
CLOCK_MONOTONIC
;
...
...
@@ -482,9 +481,13 @@ uint64_t belle_sip_time_ms(void){
return
0
;
}
return
(
ts
.
tv_sec
*
1000LL
)
+
(
ts
.
tv_nsec
/
1000000LL
);
}
#else
uint64_t
belle_sip_time_ms
(
void
){
return
GetTickCount
();
/* note use GetTickCount64 on windows phone 8*/
}
#endif
/**
* parser parameter pair
...
...
@@ -526,8 +529,16 @@ unsigned int belle_sip_random(void){
belle_sip_error
(
"Reading /dev/urandom failed."
);
}
else
return
tmp
;
}
else
belle_sip_error
(
"Could not open /dev/urandom"
);
#endif
#elif defined(WIN32)
static
int
initd
=
0
;
if
(
!
initd
)
{
srand
(
belle_sip_time_ms
());
initd
=
1
;
}
return
rand
()
<<
16
|
rand
();
#else
return
(
unsigned
int
)
random
();
#endif
}
static
const
char
*
symbols
=
"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-~"
;
...
...
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