Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Patched to compile on Cygwin.
  • Loading branch information
icculus committed Jun 29, 2002
1 parent b898225 commit 3b0f1c8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
11 changes: 11 additions & 0 deletions configure.in
Expand Up @@ -205,6 +205,16 @@ fi

AC_MSG_RESULT([$this_is_beos])

AC_MSG_CHECKING([if this is Cygwin])
if test x$build_os = xcygwin; then
this_is_cygwin=yes
CFLAGS="$CFLAGS -DWIN32"
else
this_is_cygwin=no
fi

AC_MSG_RESULT([$this_is_cygwin])

this_is_macosx=no
if test x$we_have_sed = xyes; then
AC_MSG_CHECKING([if this is MacOS X])
Expand Down Expand Up @@ -237,6 +247,7 @@ AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)

LDFLAGS="$LDFLAGS -no-undefined"

Expand Down
4 changes: 4 additions & 0 deletions platform/posix.c
Expand Up @@ -10,6 +10,8 @@
# include <config.h>
#endif

#if (!defined WIN32)

#if (defined __STRICT_ANSI__)
#define __PHYSFS_DOING_STRICT_ANSI__
#endif
Expand Down Expand Up @@ -512,5 +514,7 @@ PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *fname)
return statbuf.st_mtime;
} /* __PHYSFS_platformGetLastModTime */

#endif /* !defined WIN32 */

/* end of posix.c ... */

6 changes: 6 additions & 0 deletions platform/unix.c
Expand Up @@ -12,6 +12,10 @@

#if (!defined __BEOS__) /* BeOS uses beos.cpp and posix.c ... */

#if (defined WIN32) /* cygwin/mingw32? */
#include "win32.c" /* !!! FIXME: holy friggin' hack. */
#else

#if ((defined __APPLE__) && (defined __MACH__))
# if (!defined __DARWIN__)
# define __DARWIN__
Expand Down Expand Up @@ -302,6 +306,8 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
pthread_mutex_unlock((pthread_mutex_t *) mutex);
} /* __PHYSFS_platformReleaseMutex */

#endif /* win32 check. */

#endif /* !defined __BEOS__ */

/* end of unix.c ... */
Expand Down
6 changes: 5 additions & 1 deletion platform/win32.c
Expand Up @@ -20,6 +20,10 @@
#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"

#ifndef _MSC_VER /* for Cygwin, etc. */
#define _alloca alloca
#endif

#define LOWORDER_UINT64(pos) (PHYSFS_uint32)(pos & 0x00000000FFFFFFFF)
#define HIGHORDER_UINT64(pos) (PHYSFS_uint32)(pos & 0xFFFFFFFF00000000)

Expand Down Expand Up @@ -701,7 +705,7 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
return retval;
}

PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, void *buffer,
PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
PHYSFS_uint32 size, PHYSFS_uint32 count)
{
HANDLE FileHandle;
Expand Down

0 comments on commit 3b0f1c8

Please sign in to comment.