opusfile icon indicating copy to clipboard operation
opusfile copied to clipboard

Fix incorrect usage for file-access.

Open oontvoo opened this issue 5 years ago • 6 comments

Immediate symptom is that in src/stream.c, declarations for ftello(...) and fseeko(...) are not available.

(Errors will be raised if compiled with -Wimplicit-function-declaration

oontvoo avatar Nov 01 '19 02:11 oontvoo

You hit the delete or backspace key a little too much resulting in the following brokenness...

-# include <stdlib.h>
+#endif# include <stdlib.h>

sezero avatar Nov 06 '19 22:11 sezero

Simplified / cleaned up patch:

diff --git a/src/internal.h b/src/internal.h
index 9ac17e0..62b235f 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -18,6 +18,8 @@
 # if !defined(_GNU_SOURCE)
 #  define _GNU_SOURCE
 # endif
+/* 64-bit file access is broken before ANDROID 24. */
+# if !defined(__ANDROID__)||__ANDROID_API__ >= 24
 # if !defined(_LARGEFILE_SOURCE)
 #  define _LARGEFILE_SOURCE
 # endif
@@ -27,6 +29,7 @@
 # if !defined(_FILE_OFFSET_BITS)
 #  define _FILE_OFFSET_BITS 64
 # endif
+# endif
 
 # include <stdlib.h>
 # include <opusfile.h>

sezero avatar Nov 17 '19 18:11 sezero

@sezero Hi, has your patch been merged into the repo? Should I close this pull request?

oontvoo avatar Dec 03 '19 16:12 oontvoo

@sezero Hi, has your patch been merged into the repo?

No. I just added my comments here to notify you of the issues in your patch, that's all.

sezero avatar Dec 03 '19 16:12 sezero

Further research suggests it's only API levels 21, 22, and 23 which were broken. Prior to that the defines were just ignored by the NDK.

rillian avatar May 02 '20 17:05 rillian

Actually, this also depends on the ndk version.

rillian avatar May 02 '20 21:05 rillian