Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
698a4319
Commit
698a4319
authored
Feb 19, 2025
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fs.
parent
eee86a0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
external/fs/fs.c
external/fs/fs.c
+10
-10
external/fs/fs.h
external/fs/fs.h
+7
-0
No files found.
external/fs/fs.c
View file @
698a4319
...
...
@@ -11,14 +11,14 @@
#if defined(_WIN32)
#include <windows.h>
/* <-- Just can't get away from this darn thing... Needed for mutexes and file iteration. */
static
in
t
fs_result_from_GetLastError
(
DWORD
error
)
static
fs_resul
t
fs_result_from_GetLastError
(
DWORD
error
)
{
switch
(
error
)
{
case
ERROR_SUCCESS
:
return
FS_SUCCESS
;
case
ERROR_NOT_ENOUGH_MEMORY
:
return
ENOMEM
;
case
ERROR_
SEM_TIMEOUT
:
return
ETIMEDOUT
;
case
ERROR_
BUSY
:
return
EBUSY
;
case
ERROR_NOT_ENOUGH_MEMORY
:
return
FS_OUT_OF_MEMORY
;
case
ERROR_
BUSY
:
return
FS_BUSY
;
case
ERROR_
SEM_TIMEOUT
:
return
FS_TIMEOUT
;
default:
break
;
}
...
...
@@ -1376,9 +1376,11 @@ static fs_result fs_file_duplicate_proxy(fs_file* pFile, fs_file* pDuplicatedFil
/* Increment the reference count of the opened archive if necessary. */
if
(
fs_file_proxy_get_unref_archive_on_close
(
pFile
))
{
fs
*
pOwnerFS
;
fs_file_proxy_set_unref_archive_on_close
(
pDuplicatedFile
,
FS_TRUE
);
fs
*
pOwnerFS
=
fs_proxy_get_owner_fs
(
pFS
);
pOwnerFS
=
fs_proxy_get_owner_fs
(
pFS
);
if
(
pOwnerFS
!=
NULL
)
{
fs_increment_opened_archive_ref_count
(
pOwnerFS
,
pFS
);
}
...
...
@@ -4517,7 +4519,7 @@ static fs_uint64 fs_FILETIME_to_unix(const FILETIME* pFT)
li
.
HighPart
=
pFT
->
dwHighDateTime
;
li
.
LowPart
=
pFT
->
dwLowDateTime
;
return
(
fs_uint64
)(
li
.
QuadPart
/
10000000UL
L
-
11644473600UL
L
);
/* Convert from Windows epoch to Unix epoch. */
return
(
fs_uint64
)(
li
.
QuadPart
/
10000000UL
-
11644473600U
L
);
/* Convert from Windows epoch to Unix epoch. */
}
static
fs_file_info
fs_file_info_from_WIN32_FIND_DATAW
(
const
WIN32_FIND_DATAW
*
pFD
)
...
...
@@ -5048,7 +5050,7 @@ FS_API fs_result fs_file_duplicate_stdio(fs_file* pFile, fs_file* pDuplicatedFil
return
fs_result_from_errno
(
GetLastError
());
}
fdDuplicate
=
_open_osfhandle
((
intptr_t
)
hFileDuplicate
,
_O_RDONLY
);
fdDuplicate
=
_open_osfhandle
((
fs_intptr
)
hFileDuplicate
,
_O_RDONLY
);
if
(
fdDuplicate
==
-
1
)
{
CloseHandle
(
hFileDuplicate
);
return
fs_result_from_errno
(
errno
);
...
...
@@ -6003,8 +6005,6 @@ FS_API int fs_path_normalize(char* pDst, size_t dstCap, const char* pPath, size_
/* BEG fs_memory_stream.c */
#include <stdint.h>
static
fs_result
fs_memory_stream_read_internal
(
fs_stream
*
pStream
,
void
*
pDst
,
size_t
bytesToRead
,
size_t
*
pBytesRead
)
{
return
fs_memory_stream_read
((
fs_memory_stream
*
)
pStream
,
pDst
,
bytesToRead
,
pBytesRead
);
...
...
@@ -6030,7 +6030,7 @@ static fs_result fs_memory_stream_tell_internal(fs_stream* pStream, fs_int64* pC
return
result
;
}
if
(
cursor
>
INT64_MAX
)
{
/* <-- INT64_MAX may not be defined on some compilers. Need to check this. Can easily define this ourselves. */
if
(
cursor
>
FS_
INT64_MAX
)
{
/* <-- INT64_MAX may not be defined on some compilers. Need to check this. Can easily define this ourselves. */
return
FS_ERROR
;
}
...
...
external/fs/fs.h
View file @
698a4319
...
...
@@ -580,8 +580,10 @@ extern "C" {
#if FS_SIZEOF_PTR == 8
typedef
unsigned
long
long
fs_uintptr
;
typedef
long
long
fs_intptr
;
#else
typedef
unsigned
int
fs_uintptr
;
typedef
int
fs_intptr
;
#endif
typedef
unsigned
char
fs_bool8
;
...
...
@@ -590,6 +592,9 @@ typedef unsigned int fs_bool32;
#define FS_FALSE 0
#define FS_INT64_MAX ((fs_int64)(((fs_uint64)0x7FFFFFFF << 32) | 0xFFFFFFFF))
#ifndef FS_API
#define FS_API
#endif
...
...
@@ -659,8 +664,10 @@ typedef enum fs_result
FS_IS_DIRECTORY
=
-
15
,
FS_DIRECTORY_NOT_EMPTY
=
-
16
,
FS_AT_END
=
-
17
,
FS_BUSY
=
-
19
,
FS_BAD_SEEK
=
-
25
,
FS_NOT_IMPLEMENTED
=
-
29
,
FS_TIMEOUT
=
-
34
,
FS_CHECKSUM_MISMATCH
=
-
100
,
FS_NO_BACKEND
=
-
101
}
fs_result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment