Changed so that this builds a reasonable default with no command line #defines.

That is, it now builds .zip and native dir support, and that's it.
This commit is contained in:
Ryan C. Gordon 2012-03-23 00:52:32 -04:00
parent cd5362cc57
commit 0584117f85
10 changed files with 56 additions and 34 deletions

View File

@ -24,11 +24,11 @@
* This file written by Ryan C. Gordon. * This file written by Ryan C. Gordon.
*/ */
#if (defined PHYSFS_SUPPORTS_GRP)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_GRP
static UNPKentry *grpLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount) static UNPKentry *grpLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount)
{ {
PHYSFS_uint32 location = 16; /* sizeof sig. */ PHYSFS_uint32 location = 16; /* sizeof sig. */

View File

@ -29,11 +29,11 @@
* Based on grp.c by Ryan C. Gordon. * Based on grp.c by Ryan C. Gordon.
*/ */
#if (defined PHYSFS_SUPPORTS_HOG)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_HOG
static UNPKentry *hogLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 *_entCount) static UNPKentry *hogLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 *_entCount)
{ {
const PHYSFS_uint64 iolen = io->length(io); const PHYSFS_uint64 iolen = io->length(io);

View File

@ -24,11 +24,11 @@
* - Ambiguities in the standard * - Ambiguities in the standard
*/ */
#if (defined PHYSFS_SUPPORTS_ISO9660)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_ISO9660
#include <time.h> #include <time.h>
/* cache files smaller than this completely in memory */ /* cache files smaller than this completely in memory */

View File

@ -7,11 +7,11 @@
* by Igor Pavlov. * by Igor Pavlov.
*/ */
#if (defined PHYSFS_SUPPORTS_7Z)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_7Z
#include "lzma/C/7zCrc.h" #include "lzma/C/7zCrc.h"
#include "lzma/C/Archive/7z/7zIn.h" #include "lzma/C/Archive/7z/7zIn.h"
#include "lzma/C/Archive/7z/7zExtract.h" #include "lzma/C/Archive/7z/7zExtract.h"

View File

@ -27,11 +27,11 @@
* Based on grp.c by Ryan C. Gordon. * Based on grp.c by Ryan C. Gordon.
*/ */
#if (defined PHYSFS_SUPPORTS_MVL)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_MVL
static UNPKentry *mvlLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount) static UNPKentry *mvlLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount)
{ {
PHYSFS_uint32 location = 8; /* sizeof sig. */ PHYSFS_uint32 location = 8; /* sizeof sig. */

View File

@ -29,11 +29,11 @@
* This file written by Ryan C. Gordon. * This file written by Ryan C. Gordon.
*/ */
#if (defined PHYSFS_SUPPORTS_QPAK)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_QPAK
/* !!! FIXME: what is this here for? */ /* !!! FIXME: what is this here for? */
#if 1 /* Make this case insensitive? */ #if 1 /* Make this case insensitive? */
#define QPAK_strcmp(x, y) __PHYSFS_stricmpASCII(x, y) #define QPAK_strcmp(x, y) __PHYSFS_stricmpASCII(x, y)

View File

@ -42,11 +42,11 @@
* Ryan C. Gordon. * Ryan C. Gordon.
*/ */
#if (defined PHYSFS_SUPPORTS_WAD)
#define __PHYSICSFS_INTERNAL__ #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h" #include "physfs_internal.h"
#if PHYSFS_SUPPORTS_WAD
static UNPKentry *wadLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount) static UNPKentry *wadLoadEntries(PHYSFS_Io *io, PHYSFS_uint32 fileCount)
{ {
PHYSFS_uint32 directoryOffset; PHYSFS_uint32 directoryOffset;

View File

@ -7,14 +7,14 @@
* by Gilles Vollant. * by Gilles Vollant.
*/ */
#if (defined PHYSFS_SUPPORTS_ZIP) #define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"
#if PHYSFS_SUPPORTS_ZIP
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"
#define USE_MINIZ 1 #define USE_MINIZ 1
#if USE_MINIZ #if USE_MINIZ
#include "physfs_miniz.h" #include "physfs_miniz.h"

View File

@ -68,28 +68,28 @@ extern const PHYSFS_Archiver __PHYSFS_Archiver_ISO9660;
static const PHYSFS_ArchiveInfo *supported_types[] = static const PHYSFS_ArchiveInfo *supported_types[] =
{ {
#if (defined PHYSFS_SUPPORTS_ZIP) #if PHYSFS_SUPPORTS_ZIP
&__PHYSFS_ArchiveInfo_ZIP, &__PHYSFS_ArchiveInfo_ZIP,
#endif #endif
#if (defined PHYSFS_SUPPORTS_7Z) #if PHYSFS_SUPPORTS_7Z
&__PHYSFS_ArchiveInfo_LZMA, &__PHYSFS_ArchiveInfo_LZMA,
#endif #endif
#if (defined PHYSFS_SUPPORTS_GRP) #if PHYSFS_SUPPORTS_GRP
&__PHYSFS_ArchiveInfo_GRP, &__PHYSFS_ArchiveInfo_GRP,
#endif #endif
#if (defined PHYSFS_SUPPORTS_QPAK) #if PHYSFS_SUPPORTS_QPAK
&__PHYSFS_ArchiveInfo_QPAK, &__PHYSFS_ArchiveInfo_QPAK,
#endif #endif
#if (defined PHYSFS_SUPPORTS_HOG) #if PHYSFS_SUPPORTS_HOG
&__PHYSFS_ArchiveInfo_HOG, &__PHYSFS_ArchiveInfo_HOG,
#endif #endif
#if (defined PHYSFS_SUPPORTS_MVL) #if PHYSFS_SUPPORTS_MVL
&__PHYSFS_ArchiveInfo_MVL, &__PHYSFS_ArchiveInfo_MVL,
#endif #endif
#if (defined PHYSFS_SUPPORTS_WAD) #if PHYSFS_SUPPORTS_WAD
&__PHYSFS_ArchiveInfo_WAD, &__PHYSFS_ArchiveInfo_WAD,
#endif #endif
#if (defined PHYSFS_SUPPORTS_ISO9660) #if PHYSFS_SUPPORTS_ISO9660
&__PHYSFS_ArchiveInfo_ISO9660, &__PHYSFS_ArchiveInfo_ISO9660,
#endif #endif
NULL NULL
@ -97,28 +97,28 @@ static const PHYSFS_ArchiveInfo *supported_types[] =
static const PHYSFS_Archiver *archivers[] = static const PHYSFS_Archiver *archivers[] =
{ {
#if (defined PHYSFS_SUPPORTS_ZIP) #if PHYSFS_SUPPORTS_ZIP
&__PHYSFS_Archiver_ZIP, &__PHYSFS_Archiver_ZIP,
#endif #endif
#if (defined PHYSFS_SUPPORTS_7Z) #if PHYSFS_SUPPORTS_7Z
&__PHYSFS_Archiver_LZMA, &__PHYSFS_Archiver_LZMA,
#endif #endif
#if (defined PHYSFS_SUPPORTS_GRP) #if PHYSFS_SUPPORTS_GRP
&__PHYSFS_Archiver_GRP, &__PHYSFS_Archiver_GRP,
#endif #endif
#if (defined PHYSFS_SUPPORTS_QPAK) #if PHYSFS_SUPPORTS_QPAK
&__PHYSFS_Archiver_QPAK, &__PHYSFS_Archiver_QPAK,
#endif #endif
#if (defined PHYSFS_SUPPORTS_HOG) #if PHYSFS_SUPPORTS_HOG
&__PHYSFS_Archiver_HOG, &__PHYSFS_Archiver_HOG,
#endif #endif
#if (defined PHYSFS_SUPPORTS_MVL) #if PHYSFS_SUPPORTS_MVL
&__PHYSFS_Archiver_MVL, &__PHYSFS_Archiver_MVL,
#endif #endif
#if (defined PHYSFS_SUPPORTS_WAD) #if PHYSFS_SUPPORTS_WAD
&__PHYSFS_Archiver_WAD, &__PHYSFS_Archiver_WAD,
#endif #endif
#if (defined PHYSFS_SUPPORTS_ISO9660) #if PHYSFS_SUPPORTS_ISO9660
&__PHYSFS_Archiver_ISO9660, &__PHYSFS_Archiver_ISO9660,
#endif #endif
NULL NULL

View File

@ -96,6 +96,28 @@ void __PHYSFS_smallFree(void *ptr);
#define free(x) Do not use free() directly. #define free(x) Do not use free() directly.
/* !!! FIXME: add alloca check here. */ /* !!! FIXME: add alloca check here. */
#ifndef PHYSFS_SUPPORTS_ZIP
#define PHYSFS_SUPPORTS_ZIP 1
#endif
#ifndef PHYSFS_SUPPORTS_7Z
#define PHYSFS_SUPPORTS_7Z 0
#endif
#ifndef PHYSFS_SUPPORTS_GRP
#define PHYSFS_SUPPORTS_GRP 0
#endif
#ifndef PHYSFS_SUPPORTS_HOG
#define PHYSFS_SUPPORTS_HOG 0
#endif
#ifndef PHYSFS_SUPPORTS_MVL
#define PHYSFS_SUPPORTS_MVL 0
#endif
#ifndef PHYSFS_SUPPORTS_WAD
#define PHYSFS_SUPPORTS_WAD 0
#endif
#ifndef PHYSFS_SUPPORTS_ISO9660
#define PHYSFS_SUPPORTS_ISO9660 0
#endif
#define DIR_ARCHIVE_DESCRIPTION "Non-archive, direct filesystem I/O" #define DIR_ARCHIVE_DESCRIPTION "Non-archive, direct filesystem I/O"
#define GRP_ARCHIVE_DESCRIPTION "Build engine Groupfile format" #define GRP_ARCHIVE_DESCRIPTION "Build engine Groupfile format"
#define HOG_ARCHIVE_DESCRIPTION "Descent I/II HOG file format" #define HOG_ARCHIVE_DESCRIPTION "Descent I/II HOG file format"