Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Havar
asn1c
Commits
217f2403
Commit
217f2403
authored
Nov 21, 2006
by
Lev Walkin
Browse files
ntohl
parent
1fc091cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
skeletons/asn_system.h
View file @
217f2403
...
...
@@ -26,6 +26,12 @@
#define snprintf _snprintf
#define vsnprintf _vsnprintf
/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
#define sys_ntohl(l) ((((l) << 24) & 0xff000000)
|
(((
l
)
<<
16
)
&
0xff0000
)
|
(((
l
)
<<
8
)
&
0xff00
)
|
((
l
)
&
0xff
))
#ifdef _MSC_VER
/* MSVS.Net */
#ifndef __cplusplus
#define inline __inline
...
...
@@ -74,6 +80,9 @@ typedef unsigned int uint32_t;
#endif
/* defined(sun) */
#endif
#include <netinet/in.h>
/* for ntohl() */
#define sys_ntohl(foo) ntohl(foo)
#endif
/* defined(__vxworks) */
#endif
/* WIN32 */
...
...
skeletons/constr_SET.c
View file @
217f2403
...
...
@@ -6,12 +6,6 @@
#include <asn_internal.h>
#include <constr_SET.h>
#ifndef WIN32
#include <netinet/in.h>
/* for ntohl() */
#else
#include <winsock2.h>
/* for ntohl() */
#endif
/* Check that all the mandatory members are present */
static
int
_SET_is_populated
(
asn_TYPE_descriptor_t
*
td
,
void
*
st
);
...
...
@@ -411,7 +405,7 @@ _SET_is_populated(asn_TYPE_descriptor_t *td, void *st) {
midx
=
edx
/
(
8
*
sizeof
(
specs
->
_mandatory_elements
[
0
]));
pres
=
((
unsigned
int
*
)((
char
*
)
st
+
specs
->
pres_offset
))[
midx
];
must
=
ntohl
(
specs
->
_mandatory_elements
[
midx
]);
must
=
sys_
ntohl
(
specs
->
_mandatory_elements
[
midx
]);
if
((
pres
&
must
)
==
must
)
{
/*
...
...
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