Files
chmlib/chmlib-c99.patch
Dirk Mueller b79535abee - drop chmlib-0.39.diff - superseded by
chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch
- add
  chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch,
  chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch,
  chm_http-port-shortopt.patch, chm_http-bind-localhost.patch,
  chm_http-output-server-address.patch: restrict access to
  localhost to somewhat reduce reach
- remove static libraries and "la" files
   * all of the dynamically-sized buffers which were allocated on

OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/chmlib?expand=0&rev=14
2023-10-05 09:52:16 +00:00

37 lines
1.1 KiB
Diff

Avoid implicit function declarations, for C99 compatibility
Include <arpa/inet.h> for inet_addr, <unistd.h> for close,
write. Define _LARGEFILE64_SOURCE so that <unistd.h> defines pread64.
This avoids build failures with future compilers which do not support
implicit function declarations by default.
Submitted upstream: <https://github.com/jedwing/CHMLib/pull/17>
diff --git a/src/chm_http.c b/src/chm_http.c
index dd2787c52dece02b..08afb24db15830f9 100644
--- a/src/chm_http.c
+++ b/src/chm_http.c
@@ -43,6 +43,8 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
/* threading includes */
#include <pthread.h>
diff --git a/src/chm_lib.c b/src/chm_lib.c
index ffd213c4f66d4319..9eb9d1b915364e60 100644
--- a/src/chm_lib.c
+++ b/src/chm_lib.c
@@ -48,6 +48,8 @@
* *
***************************************************************************/
+#define _LARGEFILE64_SOURCE /* for pread64 */
+
#include "chm_lib.h"
#ifdef CHM_MT