Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
ngtcp2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kashyap Thimmaraju
ngtcp2
Commits
695d8cea
Commit
695d8cea
authored
4 years ago
by
Tatsuhiro Tsujikawa
Browse files
Options
Downloads
Patches
Plain Diff
Define ngtcp2_ntohl64 and ngtcp2_htonl64 as noop for bigendian system
parent
c0235d3c
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+3
-0
3 additions, 0 deletions
CMakeLists.txt
configure.ac
+5
-0
5 additions, 0 deletions
configure.ac
lib/ngtcp2_conv.h
+19
-6
19 additions, 6 deletions
lib/ngtcp2_conv.h
with
27 additions
and
6 deletions
CMakeLists.txt
+
3
−
0
View file @
695d8cea
...
...
@@ -142,6 +142,7 @@ check_include_file("string.h" HAVE_STRING_H)
check_include_file
(
"unistd.h"
HAVE_UNISTD_H
)
check_include_file
(
"sys/endian.h"
HAVE_SYS_ENDIAN_H
)
check_include_file
(
"endian.h"
HAVE_ENDIAN_H
)
check_include_file
(
"byteswap.h"
HAVE_BYTESWAP_H
)
include
(
CheckTypeSize
)
# Checks for typedefs, structures, and compiler characteristics.
...
...
@@ -161,6 +162,8 @@ if(HAVE_SYS_ENDIAN_H)
check_symbol_exists
(
be64toh
"sys/endian.h"
HAVE_BE64TOH
)
endif
()
check_symbol_exists
(
bswap_64
"byteswap.h"
HAVE_BSWAP_64
)
include
(
ExtractValidFlags
)
set
(
WARNCFLAGS
)
set
(
WARNCXXFLAGS
)
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
5
−
0
View file @
695d8cea
...
...
@@ -294,6 +294,7 @@ AC_CHECK_HEADERS([ \
unistd.h \
sys/endian.h \
endian.h \
byteswap.h \
])
# Checks for typedefs, structures, and compiler characteristics.
...
...
@@ -331,6 +332,10 @@ AC_CHECK_DECLS([be64toh], [], [], [[
#endif
]])
AC_CHECK_DECLS([bswap_64], [], [], [[
#include <byteswap.h>
]])
# More compiler flags from nghttp2.
save_CFLAGS=$CFLAGS
save_CXXFLAGS=$CXXFLAGS
...
...
This diff is collapsed.
Click to expand it.
lib/ngtcp2_conv.h
+
19
−
6
View file @
695d8cea
...
...
@@ -37,6 +37,10 @@
# include <netinet/in.h>
#endif
/* HAVE_NETINET_IN_H */
#ifdef HAVE_BYTESWAP_H
# include <byteswap.h>
#endif
/* HAVE_BYTESWAP_H */
#ifdef HAVE_ENDIAN_H
# include <endian.h>
#endif
/* HAVE_ENDIAN_H */
...
...
@@ -47,16 +51,25 @@
#include
<ngtcp2/ngtcp2.h>
#if defined HAVE_BSWAP_64 || HAVE_DECL_BSWAP_64
# define ngtcp2_bswap64 bswap_64
#else
/* !HAVE_BSWAP_64 */
# define ngtcp2_bswap64(N) \
((uint64_t)(ntohl((uint32_t)(N))) << 32 | ntohl((uint32_t)((N) >> 32)))
#endif
/* !HAVE_BSWAP_64 */
#if defined HAVE_BE64TOH || HAVE_DECL_BE64TOH
# define ngtcp2_ntohl64(N) be64toh(N)
# define ngtcp2_htonl64(N) htobe64(N)
#else
/* !HAVE_BE64TOH */
# define ngtcp2_bswap64(N) \
((uint64_t)(ntohl((uint32_t)(N))) << 32 | ntohl((uint32_t)((N) >> 32)))
# define ngtcp2_ntohl64(N) ngtcp2_bswap64(N)
# define ngtcp2_htonl64(N) ngtcp2_bswap64(N)
#endif
/* !HAVE_BE64TOH */
# if defined WORDS_BIGENDIAN
# define ngtcp2_ntohl64(N) (N)
# define ngtcp2_htonl64(N) (N)
# else
/* !WORDS_BIGENDIAN */
# define ngtcp2_ntohl64(N) ngtcp2_bswap64(N)
# define ngtcp2_htonl64(N) ngtcp2_bswap64(N)
# endif
/* !WORDS_BIGENDIAN */
#endif
/* !HAVE_BE64TOH */
#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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment