Skip to content

Commit

Permalink
introduce zzip/__param.h to void using zzip/file.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gdraheim committed Feb 29, 2024
1 parent 5462e80 commit 0378386
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bins/unzzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <zzip/__string.h>
#include <zzip/__mkdir.h>
#include <zzip/__debug.h>
#include <zzip/file.h>
#include <zzip/__param.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
11 changes: 8 additions & 3 deletions zzip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ set(libzzip_INCS
__hints.h
__mkdir.h
__mmap.h
__param.h
__string.h)

set(libzzipfseeko_SRCS fseeko.c fetch.c)
Expand All @@ -186,18 +187,22 @@ set(libzzipmmapped_HDRS mmapped.h memdisk.h)

add_library(libzzip ${libzzip_SRCS} )
target_link_libraries(libzzip ZLIB::ZLIB )
target_include_directories (libzzip PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} PUBLIC $<INSTALL_INTERFACE:include/zzip>)
target_include_directories (libzzip
PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
PUBLIC $<INSTALL_INTERFACE:include/zzip>)

if(ZZIPFSEEKO)
add_library(libzzipfseeko ${libzzipfseeko_SRCS} )
target_link_libraries(libzzipfseeko ZLIB::ZLIB )
target_include_directories (libzzipfseeko PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
target_include_directories (libzzipfseeko
PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
endif()

if(ZZIPMMAPPED)
add_library(libzzipmmapped ${libzzipmmapped_SRCS} )
target_link_libraries(libzzipmmapped ZLIB::ZLIB )
target_include_directories (libzzipmmapped PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
target_include_directories (libzzipmmapped
PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
endif()

set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
Expand Down
18 changes: 18 additions & 0 deletions zzip/__param.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef __ZZIP_INTERNAL_PARAM_H
#define __ZZIP_INTERNAL_PARAM_H

#include <zzip/conf.h>

#ifdef ZZIP_HAVE_SYS_PARAM_H
#include <sys/param.h> /* PATH_MAX */
#endif

#ifndef PATH_MAX
#ifdef MAX_PATH /* windows */
#define PATH_MAX MAX_PATH
#else
#define PATH_MAX 512
#endif
#endif

#endif
11 changes: 1 addition & 10 deletions zzip/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,8 @@
#endif
#endif

#ifdef ZZIP_HAVE_SYS_PARAM_H
#include <sys/param.h> /* PATH_MAX */
#endif
#include <zzip/__param.h>

#ifndef PATH_MAX
#ifdef MAX_PATH /* windows */
#define PATH_MAX MAX_PATH
#else
#define PATH_MAX 512
#endif
#endif
/*
* ZZIP_FILE structure... currently no need to unionize, since structure needed
* for inflate is superset of structure needed for unstore.
Expand Down

0 comments on commit 0378386

Please sign in to comment.