Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect usage for file-access. #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oontvoo
Copy link

@oontvoo oontvoo commented Nov 1, 2019

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

@sezero
Copy link
Contributor

sezero commented Nov 6, 2019

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

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

@sezero
Copy link
Contributor

sezero commented Nov 17, 2019

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>

@oontvoo
Copy link
Author

oontvoo commented Dec 3, 2019

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

@sezero
Copy link
Contributor

sezero commented Dec 3, 2019

@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.

@rillian
Copy link
Contributor

rillian commented May 2, 2020

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
Copy link
Contributor

rillian commented May 2, 2020

Actually, this also depends on the ndk version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants