diff options
author | Eric Biggers <ebiggers@google.com> | 2023-01-21 12:31:58 -0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-01-27 12:33:59 -0500 |
commit | 11f1e85ee3b96bdd08c69d8617cd82f5462e7f0b (patch) | |
tree | 4a3a5ce95eb71f9e87995f2fb6d8ce75f3358c4c /include | |
parent | 073feec96664cd241c9e300b42f63aba1a2c9f4f (diff) | |
download | e2fsprogs-11f1e85ee3b96bdd08c69d8617cd82f5462e7f0b.tar.gz |
lib, misc: eliminate dependency on Winsock
Currently Windows builds of e2fsprogs rely on the Windows Socket API
(Winsock) to provide htonl() and ntohl(). For this to actually work,
though, HAVE_WINSOCK_H needs to be defined, and the binaries need to be
linked to -lws2_32. The Android.bp files do this; however, the
autotools-based build system does not.
Since htonl() and ntohl() are trivial, let's instead just add a file
include/mingw/arpa/inet.h with definitions for these.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw/arpa/inet.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mingw/arpa/inet.h b/include/mingw/arpa/inet.h new file mode 100644 index 00000000..55dfa369 --- /dev/null +++ b/include/mingw/arpa/inet.h @@ -0,0 +1,5 @@ +#pragma once + +/* Windows is always little endian. */ +#define htonl __builtin_bswap32 +#define ntohl __builtin_bswap32 |