Skip to content

Commit

Permalink
Feature puff: unconditionally have one symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Jan 22, 2024
1 parent 7587b56 commit 01af4f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/sc_builtin/sc_puff.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@

/* every libsc file includes at least sc_config.h */
#include <sc_config.h>
#ifdef SC_HAVE_ZLIB
/* puff is not necessary and not used in the library */

/** Make sure there is at least one symbol in the file. */
extern const int sc_puff_dummy;
#else

#ifndef SC_HAVE_ZLIB
/* sc_puff is a fallback for the zlib uncompress function */

/* convenient define for code to fallback even further without puff */
#define SC_PUFF_INCLUDED
Expand Down
11 changes: 6 additions & 5 deletions src/sc_puff.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
* inclusion, an extern "C", and white space.
*/

#include <sc_config.h>
#ifdef SC_HAVE_ZLIB
/* make sure the file contains at least one symbol */
#include "sc_builtin/sc_puff.h" /* prototype for sc_puff() */

/* Make sure there is at least one symbol in the file. */
const int sc_puff_dummy = 1;
#else

#include "sc_builtin/sc_puff.h" /* prototype for sc_puff() */
#ifdef SC_PUFF_INCLUDED
/* sc_puff is a fallback for the zlib uncompress function */

#ifndef NIL
# define NIL ((unsigned char *)0) /* for no output option */
#endif
Expand Down

0 comments on commit 01af4f6

Please sign in to comment.