Skip to content

Commit

Permalink
Hardcoded paths to geogram in zlib (else I think it gets another
Browse files Browse the repository at this point in the history
zlib when compiling with emscripten)
  • Loading branch information
BrunoLevy committed May 5, 2024
1 parent 68551db commit 5498b68
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/* @(#) $Id$ */

#include "zutil.h"
#include <geogram/third_party/zlib/zutil.h>

#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"
#include <geogram/third_party/zlib/zlib.h>

/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# endif /* !DYNAMIC_CRC_TABLE */
#endif /* MAKECRCH */

#include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
#include <geogram/third_party/zlib/zutil.h> /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */

/*
A CRC of a message is computed on N braids of words in the message, where
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

/* @(#) $Id$ */

#include "deflate.h"
#include <geogram/third_party/zlib/deflate.h>

const char deflate_copyright[] =
" deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler ";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/deflate.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef DEFLATE_H
#define DEFLATE_H

#include "zutil.h"
#include <geogram/third_party/zlib/zutil.h>

/* define NO_GZIP when compiling if you want to disable gzip header and
trailer creation by deflate(). NO_GZIP would be used to avoid linking in
Expand Down
5 changes: 5 additions & 0 deletions src/lib/geogram/third_party/zlib/fix_includes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
for i in `ls *.h *.c`
do
cp $i $i.back
cat $i.back | sed -e 's|#include \"\(.*\)\"|#include <geogram/third_party/zlib/\1>|g' > $i
done
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/gzclose.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "gzguts.h"
#include <geogram/third_party/zlib/gzguts.h>

/* gzclose() is in a separate file so that it is linked in only if it is used.
That way the other gzclose functions can be used instead to avoid linking in
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/gzguts.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#endif

#include <stdio.h>
#include "zlib.h"
#include <geogram/third_party/zlib/zlib.h>
#ifdef STDC
# include <string.h>
# include <stdlib.h>
Expand Down
8 changes: 1 addition & 7 deletions src/lib/geogram/third_party/zlib/gzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "gzguts.h"
#include <geogram/third_party/zlib/gzguts.h>

#if defined(_WIN32) && !defined(__BORLANDC__)
# define LSEEK _lseeki64
Expand All @@ -15,12 +15,6 @@
#endif
#endif

/* [Bruno] for some reasons this prototype is missing (WTF??) */
#ifdef __EMSCRIPTEN__
TAGADA testing that we go there under emscripten
off_t lseek(int fd, off_t offset, int whence);
#endif

#if defined UNDER_CE

/* Map the Windows error number in ERROR to a locale-dependent error message
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/gzread.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "gzguts.h"
#include <geogram/third_party/zlib/gzguts.h>

/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
state->fd, and update state->eof, state->err, and state->msg as appropriate.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/gzwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "gzguts.h"
#include <geogram/third_party/zlib/gzguts.h>

/* Initialize state for writing a gzip file. Mark initialization by setting
state->size to non-zero. Return -1 on a memory allocation failure, or 0 on
Expand Down
8 changes: 4 additions & 4 deletions src/lib/geogram/third_party/zlib/infback.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
inflate_fast() can be used with either inflate.c or infback.c.
*/

#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#include <geogram/third_party/zlib/zutil.h>
#include <geogram/third_party/zlib/inftrees.h>
#include <geogram/third_party/zlib/inflate.h>
#include <geogram/third_party/zlib/inffast.h>

/*
strm provides memory allocation functions in zalloc and zfree, or
Expand Down
8 changes: 4 additions & 4 deletions src/lib/geogram/third_party/zlib/inffast.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#include <geogram/third_party/zlib/zutil.h>
#include <geogram/third_party/zlib/inftrees.h>
#include <geogram/third_party/zlib/inflate.h>
#include <geogram/third_party/zlib/inffast.h>

#ifdef ASMINF
# pragma message("Assembler code may have bugs -- use at your own risk")
Expand Down
8 changes: 4 additions & 4 deletions src/lib/geogram/third_party/zlib/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
* The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
*/

#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#include <geogram/third_party/zlib/zutil.h>
#include <geogram/third_party/zlib/inftrees.h>
#include <geogram/third_party/zlib/inflate.h>
#include <geogram/third_party/zlib/inffast.h>

#ifdef MAKEFIXED
# ifndef BUILDFIXED
Expand Down
4 changes: 2 additions & 2 deletions src/lib/geogram/third_party/zlib/inftrees.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#include "zutil.h"
#include "inftrees.h"
#include <geogram/third_party/zlib/zutil.h>
#include <geogram/third_party/zlib/inftrees.h>

#define MAXBITS 15

Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/* #define GEN_TREES_H */

#include "deflate.h"
#include <geogram/third_party/zlib/deflate.h>

#ifdef ZLIB_DEBUG
# include <ctype.h>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/uncompr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"
#include <geogram/third_party/zlib/zlib.h>

/* ===========================================================================
Decompresses the source buffer into the destination buffer. *sourceLen is
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifndef ZLIB_H
#define ZLIB_H

#include "zconf.h"
#include <geogram/third_party/zlib/zconf.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/zutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/* @(#) $Id$ */

#include "zutil.h"
#include <geogram/third_party/zlib/zutil.h>
#ifndef Z_SOLO
# include "gzguts.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/third_party/zlib/zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# define ZLIB_INTERNAL
#endif

#include "zlib.h"
#include <geogram/third_party/zlib/zlib.h>

#if defined(STDC) && !defined(Z_SOLO)
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
Expand Down

0 comments on commit 5498b68

Please sign in to comment.