Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
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
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
Libraries
nghttp2
Commits
61331103
Commit
61331103
authored
Mar 28, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on libws2_32 on Windows build
parent
6f58434d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
17 deletions
+44
-17
configure.ac
configure.ac
+0
-14
lib/nghttp2_net.h
lib/nghttp2_net.h
+44
-3
No files found.
configure.ac
View file @
61331103
...
...
@@ -508,13 +508,6 @@ AC_CHECK_HEADERS([ \
unistd.h \
])
case "${host}" in
*mingw*)
# For ntohl, ntohs in Windows
AC_CHECK_HEADERS([winsock2.h])
;;
esac
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
...
...
@@ -564,13 +557,6 @@ AM_CONDITIONAL([ENABLE_TINY_NGHTTPD],
[ test "x${have_epoll}" = "xyes" &&
test "x${have_timerfd_create}" = "xyes"])
dnl Windows library for winsock2
case "${host}" in
*mingw*)
LIBS="$LIBS -lws2_32"
;;
esac
ac_save_CFLAGS=$CFLAGS
CFLAGS=
...
...
lib/nghttp2_net.h
View file @
61331103
...
...
@@ -37,8 +37,49 @@
#include <netinet/in.h>
#endif
/* HAVE_NETINET_IN_H */
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
/* HAVE_WINSOCK2_H */
#include <nghttp2/nghttp2.h>
#if defined(WIN32)
/* Windows requires ws2_32 library for ntonl family functions. We
define inline functions for those function so that we don't have
dependeny on that lib. */
static
inline
uint32_t
htonl
(
uint32_t
hostlong
)
{
uint32_t
res
;
unsigned
char
*
p
=
(
unsigned
char
*
)
&
res
;
*
p
++
=
hostlong
>>
24
;
*
p
++
=
(
hostlong
>>
16
)
&
0xffu
;
*
p
++
=
(
hostlong
>>
8
)
&
0xffu
;
*
p
=
hostlong
&
0xffu
;
return
res
;
}
static
inline
uint16_t
htons
(
uint16_t
hostshort
)
{
uint16_t
res
;
unsigned
char
*
p
=
(
unsigned
char
*
)
&
res
;
*
p
++
=
hostshort
>>
8
;
*
p
=
hostshort
&
0xffu
;
return
res
;
}
static
inline
uint32_t
ntohl
(
uint32_t
netlong
)
{
uint32_t
res
;
unsigned
char
*
p
=
(
unsigned
char
*
)
&
netlong
;
res
=
*
p
++
<<
24
;
res
+=
*
p
++
<<
16
;
res
+=
*
p
++
<<
8
;
res
+=
*
p
;
return
res
;
}
static
inline
uint16_t
ntohs
(
uint16_t
netshort
)
{
uint16_t
res
;
unsigned
char
*
p
=
(
unsigned
char
*
)
&
netshort
;
res
=
*
p
++
<<
8
;
res
+=
*
p
;
return
res
;
}
#endif
/* WIN32 */
#endif
/* NGHTTP2_NET_H */
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