mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
require now looks for both .dylib and .so extensions for C dynamic libraries in macOS, instead of just .so.
It also now replaces all occurrences of '??' and '?' in the path with the module filename and module name respectively, rather than just the first occurrence. --HG-- branch : minor
This commit is contained in:
@@ -151,8 +151,6 @@ int64 File::read(void *dst, int64 size)
|
||||
int64 max = (int64)PHYSFS_fileLength(file);
|
||||
size = (size == ALL) ? max : size;
|
||||
size = (size > max) ? max : size;
|
||||
// Sadly, we'll have to clamp to 32 bits here
|
||||
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
|
||||
|
||||
if (size < 0)
|
||||
throw love::Exception("Invalid read size.");
|
||||
@@ -160,6 +158,8 @@ int64 File::read(void *dst, int64 size)
|
||||
#ifdef LOVE_USE_PHYSFS_2_1
|
||||
int64 read = PHYSFS_readBytes(file, dst, (PHYSFS_uint64) size);
|
||||
#else
|
||||
// Sadly, we'll have to clamp to 32 bits here
|
||||
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
|
||||
int64 read = (int64)PHYSFS_read(file, dst, 1, (PHYSFS_uint32) size);
|
||||
#endif
|
||||
|
||||
@@ -171,9 +171,6 @@ bool File::write(const void *data, int64 size)
|
||||
if (!file || (mode != MODE_WRITE && mode != MODE_APPEND))
|
||||
throw love::Exception("File is not opened for writing.");
|
||||
|
||||
// Another clamp, for the time being.
|
||||
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
|
||||
|
||||
if (size < 0)
|
||||
throw love::Exception("Invalid write size.");
|
||||
|
||||
@@ -181,6 +178,8 @@ bool File::write(const void *data, int64 size)
|
||||
#ifdef LOVE_USE_PHYSFS_2_1
|
||||
int64 written = PHYSFS_writeBytes(file, data, (PHYSFS_uint64) size);
|
||||
#else
|
||||
// Another clamp, for the time being.
|
||||
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
|
||||
int64 written = (int64) PHYSFS_write(file, data, 1, (PHYSFS_uint32) size);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user