applied Benjamin Riefenstahl's patches for building on Windows

This commit is contained in:
vdvo
2002-05-27 16:45:32 +00:00
parent a80a9680fe
commit 79fe4b68df
15 changed files with 76 additions and 113 deletions

View File

@@ -20,12 +20,8 @@
Arturo Tena <arturo@directmail.org>
*/
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
#include "config.h"
#include "cole.h"
#else
#include "cole.h.in"
#endif
#include "internal.h"
#include <stdlib.h>
@@ -193,7 +189,7 @@ cole_umount (COLEFS *colefilesystem, COLERRNO *colerrno)
if (colerrno != NULL) *colerrno = COLE_ECLOSEFILE;
ret = 1;
}
#if defined(__WIN32__) || (__BORLANDC__)
#if defined(WIN32)
if (remove (colefilesystem->sbfilename) && !ret) {
if (colerrno != NULL) *colerrno = COLE_EREMOVE;
ret = 1;
@@ -247,6 +243,9 @@ __cole_print_tree_indir(COLEDIR *cd, void *info, COLERRNO *colerrno)
* Modify colerrno comment in the functions that call it,
* ie. cole_print_tree().
*/
(void) cd; /*UNUSED*/
(void) colerrno; /*UNUSED*/
(*((long*)info))++;
return 0;
}
@@ -259,6 +258,9 @@ __cole_print_tree_outdir(COLEDIR *cd, void *info, COLERRNO *colerrno)
* Modify colerrno comment in the functions that call it,
* ie. cole_print_tree().
*/
(void) cd; /*UNUSED*/
(void) colerrno; /*UNUSED*/
(*((long*)info))--;
return 0;
}
@@ -273,6 +275,9 @@ __cole_print_tree_inroot(COLEDIR *cd, void *info, COLERRNO *colerrno)
*/
char *entry_name;
(void) info; /*UNUSED*/
(void) colerrno; /*UNUSED*/
printf ("DIR ");
printf (" %7zu", cole_dir_getsize (cd));
printf (" %08lx-%08lx %08lx-%08lx",
@@ -301,6 +306,8 @@ __cole_print_tree_indirentry(COLEDIRENT *cde, void *info, COLERRNO *colerrno)
long level;
long i;
(void) colerrno; /*UNUSED*/
level = *((long*)info);
for (i = 0; i < level; i++) {
if (i == level - 1)
@@ -405,6 +412,8 @@ cole_opendir_direntry (COLEDIRENT *coledirentry, COLERRNO *colerrno)
int
cole_closedir (COLEDIR *coledir, COLERRNO *colerrno)
{
(void) colerrno; /*UNUSED*/
free (coledir);
return 0;
@@ -1136,6 +1145,8 @@ cole_locate_filename (COLEFS *colefilesystem, char *filename,
static int
__cole_locate_filename_visitdir (COLEDIR *cd, void *info)
{
(void) cd; /*UNUSED*/
return ((struct __cole_locate_filenameinfo *)info)->visitdir;
}

View File

@@ -23,7 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !(defined( __WIN32__ ) || defined( __BORLANDC__ ))
#if !defined(WIN32)
#include <unistd.h>
#endif
@@ -45,7 +45,7 @@ __cole_extract_file (FILE **file, char **filename, U32 size, U32 pps_start,
long FilePos;
size_t bytes_to_copy;
U8 Block[0x0200];
#if defined( __WIN32__ ) || defined( __BORLANDC__ )
#if defined(WIN32)
FILE *ret;
*filename = (char *)malloc (TMPNAM_LEN);

View File

@@ -33,7 +33,7 @@ extern "C" {
#include "support.h"
#endif
#if defined( __WIN32__ ) || defined( __BORLANDC__ )
#if defined(WIN32)
#define TMPNAM_LEN L_tmpnam
#else
#define TMPNAM_LEN 18 /* /tmp/xlHtmlXXXXXX + NULL */

View File

@@ -25,11 +25,7 @@
#include <stdlib.h>
#include <assert.h>
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
#include "cole.h"
#else
#include "cole.h.in"
#endif
#include "support.h"
#include "internal.h"
@@ -537,6 +533,8 @@ nextff_##var=&##var;
nextff (cff);
#endif
(void) size; /*UNUSED*/
verbose ("calling: add_MY_FILE_entry ()");
#ifdef VERBOSE

View File

@@ -43,12 +43,10 @@
#include <sys/types.h>
#include <assert.h>
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
#include "cole.h"
#include "config.h"
#if !defined(WIN32)
#include <unistd.h> /* for unlink() */
#else
#include "cole.h.in"
#endif
/* FIXME: replace all VERBOSE with COLE_VERBOSE */
#ifdef COLE_VERBOSE
@@ -475,7 +473,7 @@ int __OLEdecode (char *OLEfilename, pps_entry ** stream_list, U32 * root,
test_exitf (OLEfile != NULL, 7, ends ());
verboseS (sbfilename);
*/
#if defined( __WIN32__ ) || defined( __BORLANDC__ )
#if defined(WIN32)
*_sbfilename = (U8 *)malloc (TMPNAM_LEN);
test_exitf (*_sbfilename != NULL, 10, ends ());
tmpnam (*_sbfilename);
@@ -508,7 +506,7 @@ int __OLEdecode (char *OLEfilename, pps_entry ** stream_list, U32 * root,
/* other entry, save in a file */
{
/* this branch is never executed now */
#if defined( __WIN32__ ) || defined( __BORLANDC__ )
#if defined(WIN32)
tmpnam (pps_list[i].filename);
test_exitf (pps_list[i].filename[0], 7, ends ());
verbose(pps_list[i].name + (!isprint(pps_list[i].name[0]) ? 1 : 0));

View File

@@ -37,9 +37,23 @@ extern "C" {
#include <ctype.h>
#include <stdio.h>
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
#include "config.h"
#if defined(WIN32)
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_UNSIGNED_CHAR 1
#define SIZEOF_UNSIGNED_SHORT 2
#define SIZEOF_UNSIGNED_LONG 4
/* compile time checks for good measure */
#define COMPILE_TIME_CHECK(tag,expr) \
typedef char tag##_CHECK[ (expr) ? 1 : -1 ]
COMPILE_TIME_CHECK( FLOAT, sizeof(float) == SIZEOF_FLOAT );
COMPILE_TIME_CHECK( DOUBLE, sizeof(double) == SIZEOF_DOUBLE );
COMPILE_TIME_CHECK( CHAR, sizeof(char) == SIZEOF_UNSIGNED_CHAR );
COMPILE_TIME_CHECK( SHORT, sizeof(short) == SIZEOF_UNSIGNED_SHORT );
COMPILE_TIME_CHECK( LONG, sizeof(long) == SIZEOF_UNSIGNED_LONG );
#endif
/* F32 */
#if SIZEOF_FLOAT == 4
@@ -114,19 +128,6 @@ extern "C" {
#error No 4 byte length type found.
#endif
#else
/* Borland or Wintel constants */
#define F32 float
#define F64 double
#define U8 unsigned char
#define U16 unsigned short
#define S16 signed short
#define U32 unsigned long
#define S32 signed long
#endif
U16 fil_sreadU16 (U8 * in);
U32 fil_sreadU32 (U8 * in);
F64 fil_sreadF64 (U8 * in);

View File

@@ -1,13 +1,5 @@
#ifndef __BORLANDC__
int cole_major_version = @COLE_MAJOR@;
int cole_minor_version = @COLE_MINOR@;
int cole_micro_version = @COLE_MICRO@;
char * cole_version = "@COLE_MAJOR@.@COLE_MINOR@.@COLE_MICRO@";
char * cole_host_info = "@HOST_ALIAS_NAME@ (@HOST_CANONICAL_NAME@): @HOST_CPU@, @HOST_VENDOR@, @HOST_OS@";
#else
int cole_major_version = 2;
int cole_minor_version = 0;
int cole_micro_version = 1;
char * cole_version = "2.0.1";
char * cole_host_info = "BORLANDC (Windows): i386, GPL, Win32";
#endif