Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS support: conditional inclusion of stdint.h, updates https://git… #11

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions contrib/amd64/crc32-pclmul_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* - prepend '$' to some immediate operands to make assembler happy.
*/

#if !defined(__APPLE__)

#define ENTRY(name) \
.globl name; \
.hidden name; \
Expand All @@ -53,6 +55,17 @@ name:
#define ENDPROC(name) \
.size name, .-name

#else // __APPLE__

#define ENTRY(name) \
.globl _ ## name; \
.private_extern _ ## name; \
_ ## name:

#define ENDPROC(name) /**/

#endif

.align 16
/*
* [x4*128+32 mod P(x) << 32)]' << 1 = 0x154442bd4
Expand Down
3 changes: 3 additions & 0 deletions deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
/* @(#) $Id$ */

#include "deflate.h"
#ifndef UINT32_MAX
<stdint.h>
#endif

const char deflate_copyright[] =
" deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
Expand Down
6 changes: 3 additions & 3 deletions test/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
CHECK_ERR(err, "inflateEnd");

if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
fprintf(stderr, "bad large inflate: %lld\n", d_stream.total_out);
fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
exit(1);
} else {
printf("large_inflate(): OK\n");
Expand Down Expand Up @@ -559,8 +559,8 @@ int main(argc, argv)
fprintf(stderr, "warning: different zlib version\n");
}

printf("zlib version %s = 0x%04x, compile flags = 0x%llx\n",
ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags());
printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n",
ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags());

compr = (Byte*)calloc((uInt)comprLen, 1);
uncompr = (Byte*)calloc((uInt)uncomprLen, 1);
Expand Down
8 changes: 5 additions & 3 deletions zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

#ifndef ZCONF_H
#define ZCONF_H
#include <stdint.h>
#ifndef UINT32_MAX
#include <stdint.h>
#endif
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
Expand Down Expand Up @@ -408,11 +410,11 @@ typedef uLong FAR uLongf;
typedef unsigned long z_crc_t;
#endif

#if 1 /* was set to #if 1 by ./configure */
#ifdef HAVE_UNISTD_H /* was set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif

#if 1 /* was set to #if 1 by ./configure */
#ifdef HAVE_STDARG_H /* was set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif

Expand Down
4 changes: 3 additions & 1 deletion zconf.h.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#define ZCONF_H
#cmakedefine Z_PREFIX
#cmakedefine Z_HAVE_UNISTD_H
#include <stdint.h>
#ifndef UINT32_MAX
#include <stdint.h>
#endif
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
Expand Down
4 changes: 3 additions & 1 deletion zconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

#ifndef ZCONF_H
#define ZCONF_H
#include <stdint.h>
#ifndef UINT32_MAX
#include <stdint.h>
#endif
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
Expand Down