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

Converted to android-cmake for APK creation #2526

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@tigerw
Member

tigerw commented Oct 5, 2015

  • Various changes to allow for Android to compile successfully
externalproject_add(lua_native
SOURCE_DIR ../lib/lua
CMAKE_GENERATOR "Visual Studio 14 2015"

This comment has been minimized.

@madmaxoft

madmaxoft Oct 5, 2015

Member

I don't think this is the right way to go - what about building this on Linux?

@madmaxoft

madmaxoft Oct 5, 2015

Member

I don't think this is the right way to go - what about building this on Linux?

This comment has been minimized.

@tigerw

tigerw Oct 5, 2015

Member

It's definitely not right, but conversely, I have no idea how to get the autodetection working as it does when you run cmake .

@tigerw

tigerw Oct 5, 2015

Member

It's definitely not right, but conversely, I have no idea how to get the autodetection working as it does when you run cmake .

This comment has been minimized.

@tigerw

tigerw Oct 6, 2015

Member

Would anyone have any idea about this? It could be a showstopper for integration into @bearbin's Jenkins server.

@tigerw

tigerw Oct 6, 2015

Member

Would anyone have any idea about this? It could be a showstopper for integration into @bearbin's Jenkins server.

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Looking at this again, is their any reason not to use the CMAKE_GENERATOR variable? You're always going to want to use the same generator as the main project.

@worktycho

worktycho Dec 20, 2015

Member

Looking at this again, is their any reason not to use the CMAKE_GENERATOR variable? You're always going to want to use the same generator as the main project.

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

“is there any reason not to use...”

Did you mean to use? If you did, I think it didn’t work if I didn’t specify that variable, but I’ll try again soon.

@tigerw

tigerw Dec 21, 2015

Member

“is there any reason not to use...”

Did you mean to use? If you did, I think it didn’t work if I didn’t specify that variable, but I’ll try again soon.

This comment has been minimized.

@worktycho

worktycho Apr 23, 2016

Member

I've only just seen this after your reference in #3161. But what I meant was why cant you do CMAKE_GENERATOR ${CMAKE_GENERATOR}?

@worktycho

worktycho Apr 23, 2016

Member

I've only just seen this after your reference in #3161. But what I meant was why cant you do CMAKE_GENERATOR ${CMAKE_GENERATOR}?

This comment has been minimized.

@tigerw

tigerw Apr 23, 2016

Member

Would anyone have any idea about this? It could be a showstopper for integration...

...and @worktycho comes to the rescue. :)

@tigerw

tigerw Apr 23, 2016

Member

Would anyone have any idea about this? It could be a showstopper for integration...

...and @worktycho comes to the rescue. :)

@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Oct 5, 2015

Member

So with regards to this, I'm planning to merge the core server related changes in, then remove the Android folder and place that into cuberite-android, and add the main repository as a submodule.

Member

tigerw commented Oct 5, 2015

So with regards to this, I'm planning to merge the core server related changes in, then remove the Android folder and place that into cuberite-android, and add the main repository as a submodule.

/lua_native-prefix/
/tolua_native-prefix/
CMakeCache.txt
local.properties

This comment has been minimized.

@sphinxc0re

sphinxc0re Oct 5, 2015

Contributor

missing newline

@sphinxc0re

sphinxc0re Oct 5, 2015

Contributor

missing newline

unset(_NDK_HELPER_SRCS)
endif()
endmacro()

This comment has been minimized.

@sphinxc0re

sphinxc0re Oct 5, 2015

Contributor

Missing newline

@sphinxc0re

sphinxc0re Oct 5, 2015

Contributor

Missing newline

@sphinxc0re

This comment has been minimized.

Show comment
Hide comment
@sphinxc0re

sphinxc0re Oct 5, 2015

Contributor

You should really update your branch

Contributor

sphinxc0re commented Oct 5, 2015

You should really update your branch

@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Oct 5, 2015

Member

I have updated my branch - if you're referring to project (MCServer), I did it before the rename en-masse.

Member

tigerw commented Oct 5, 2015

I have updated my branch - if you're referring to project (MCServer), I did it before the rename en-masse.

@worktycho

This comment has been minimized.

Show comment
Hide comment
@worktycho

worktycho Oct 5, 2015

Member

What about warnings? It looks like you've left it a gcc's defaults, which is particularly problematic for non-x86 platforms like android where assumptions are more likely to be violated.

Member

worktycho commented Oct 5, 2015

What about warnings? It looks like you've left it a gcc's defaults, which is particularly problematic for non-x86 platforms like android where assumptions are more likely to be violated.

@worktycho

This comment has been minimized.

Show comment
Hide comment
@worktycho

worktycho Oct 5, 2015

Member

What compile options does this build with? Experience of the pi has shown that cuberite requires several non-standard compile options on arm.

  • -fomit-frame-pointer : mbedtls miscompiles on armv6 without this
  • -fsigned-char : various bugs in cuberite's core are exposed if this is not enabled.
  • -ffast-math : improves performance, by allowing the compiler to break the IEEE 754 standard
Member

worktycho commented Oct 5, 2015

What compile options does this build with? Experience of the pi has shown that cuberite requires several non-standard compile options on arm.

  • -fomit-frame-pointer : mbedtls miscompiles on armv6 without this
  • -fsigned-char : various bugs in cuberite's core are exposed if this is not enabled.
  • -ffast-math : improves performance, by allowing the compiler to break the IEEE 754 standard
@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Oct 6, 2015

Member

Have a look at the android cmake toolchain file, I think that the first two are present. I'm not sure about the last, but I'm assuming that since soft-float is so slow, there won't be a particularly noticeable speed increase.

Member

tigerw commented Oct 6, 2015

Have a look at the android cmake toolchain file, I think that the first two are present. I'm not sure about the last, but I'm assuming that since soft-float is so slow, there won't be a particularly noticeable speed increase.

@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Oct 6, 2015

Member

About warnings; what are good warnings? Since the plan is to include the core/desktop repository as a submodule, perhaps warnings would only really be effective when generated compiling the desktop version?

Member

tigerw commented Oct 6, 2015

About warnings; what are good warnings? Since the plan is to include the core/desktop repository as a submodule, perhaps warnings would only really be effective when generated compiling the desktop version?

@worktycho

This comment has been minimized.

Show comment
Hide comment
@worktycho

worktycho Oct 6, 2015

Member

-fomit-frame-pointer is only passed in release, we need it passed in debug as well.
fast-math is especially important on soft float systems, because optimizations will have more of an effect on slower operations.

As for warnings, they are the real problem with the submodule strategy. We don't want warnings passed to library code but we do for our code. Why can you not have non-platform specific flags handled by setflags?

Member

worktycho commented Oct 6, 2015

-fomit-frame-pointer is only passed in release, we need it passed in debug as well.
fast-math is especially important on soft float systems, because optimizations will have more of an effect on slower operations.

As for warnings, they are the real problem with the submodule strategy. We don't want warnings passed to library code but we do for our code. Why can you not have non-platform specific flags handled by setflags?

@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Oct 8, 2015

Member

Okay, I'll try to SetFlags then. I didn't use it since I really couldn't be bothered to trawl through the dense file and correct the "If not Windows, is Linux" and "Linux is all the same" behaviour.

Member

tigerw commented Oct 8, 2015

Okay, I'll try to SetFlags then. I didn't use it since I really couldn't be bothered to trawl through the dense file and correct the "If not Windows, is Linux" and "Linux is all the same" behaviour.

@worktycho

This comment has been minimized.

Show comment
Hide comment
@worktycho

worktycho Oct 8, 2015

Member

Theres very little that assumes Linux. It does tend to assume a POSIXish environment if not windows, but android should be POSIXish. And we have enough special cases for POSIX, so android should be simpler. Android is closer to Linux than FreeBSD and OS X. Look at the FreeBSD build cases for examples.

Member

worktycho commented Oct 8, 2015

Theres very little that assumes Linux. It does tend to assume a POSIXish environment if not windows, but android should be POSIXish. And we have enough special cases for POSIX, so android should be simpler. Android is closer to Linux than FreeBSD and OS X. Look at the FreeBSD build cases for examples.

@sphinxc0re

This comment has been minimized.

Show comment
Hide comment
@sphinxc0re

sphinxc0re Nov 5, 2015

Contributor

Any updates?

Contributor

sphinxc0re commented Nov 5, 2015

Any updates?

@sphinxc0re

This comment has been minimized.

Show comment
Hide comment
@sphinxc0re

sphinxc0re Nov 13, 2015

Contributor

Is this still in progress or did you drop this? @tigerw

Contributor

sphinxc0re commented Nov 13, 2015

Is this still in progress or did you drop this? @tigerw

@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Nov 21, 2015

Member

Still in progress.

Member

tigerw commented Nov 21, 2015

Still in progress.

Converted to android-cmake for APK creation
* Various changes to allow for Android to compile successfully
@tigerw

This comment has been minimized.

Show comment
Hide comment
@tigerw

tigerw Dec 20, 2015

Member

Now?

Member

tigerw commented Dec 20, 2015

Now?

@@ -86,7 +86,11 @@ macro(set_flags)
else()
add_flags_cxx("-pthread")
endif()
elseif(ANDROID)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

c++11 only. I don't want to have to deal with more compiler variation than we have to. And yes, c++14 has caused breaking changes for template free functions with the same name as a new standard library function. (ADL makes it impossible to add template free functions without causing breaking changes).

@worktycho

worktycho Dec 20, 2015

Member

c++11 only. I don't want to have to deal with more compiler variation than we have to. And yes, c++14 has caused breaking changes for template free functions with the same name as a new standard library function. (ADL makes it impossible to add template free functions without causing breaking changes).

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

You won’t be dealing with it, considering this will be in a separate repository. It’ll probably end up being me dealing with it :P

@tigerw

tigerw Dec 21, 2015

Member

You won’t be dealing with it, considering this will be in a separate repository. It’ll probably end up being me dealing with it :P

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Then let me advise you to stick to c++11 to avoid having a similar problem to when a PR wouldn't compile on windows because msvc exposes std::make_unique, which was causing issues with my make_unique if it was in the global namespace.

@worktycho

worktycho Dec 21, 2015

Member

Then let me advise you to stick to c++11 to avoid having a similar problem to when a PR wouldn't compile on windows because msvc exposes std::make_unique, which was causing issues with my make_unique if it was in the global namespace.

@@ -1 +1 @@
Subproject commit 81cf237917b6873decd27e15b7fe8473003a2762
Subproject commit beae99924f29d88405576d5b9787bd494ec13e7a

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Why?

@worktycho
S.GetStackValues(2, Data, RemotePeer, RemotePort);
// Check the port:
if ((RemotePort < 0) || (RemotePort > USHRT_MAX))
if ((RemotePort < 0) || (RemotePort > std::numeric_limits<UInt16>::max()))

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

This is never true. Use the checks in GetStackValues.

@worktycho

worktycho Dec 20, 2015

Member

This is never true. Use the checks in GetStackValues.

This comment has been minimized.

@tigerw

tigerw Dec 20, 2015

Member

Oh yeah!

Then in that case, when are the checks in GetStackValues triggered? Is it something to do with a difference between lua_Number and the template type T? Is lua_Number bigger?

@tigerw

tigerw Dec 20, 2015

Member

Oh yeah!

Then in that case, when are the checks in GetStackValues triggered? Is it something to do with a difference between lua_Number and the template type T? Is lua_Number bigger?

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

GetStackValues will return false if the input value is not a number or falls outside the range of the type you have requested conversion to.

@worktycho

worktycho Dec 20, 2015

Member

GetStackValues will return false if the input value is not a number or falls outside the range of the type you have requested conversion to.

INSTALL_COMMAND ""
)
externalproject_add(tolua_native
SOURCE_DIR ../lib/tolua++

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

How is this referencing the lua target?

@worktycho

worktycho Dec 20, 2015

Member

How is this referencing the lua target?

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

I’m not sure.
• If you mean how it’s doing the referencing, I’m still not sure.
• If you mean it’s not referencing anything but that I’m saying that it is, then I’m confused.

@tigerw

tigerw Dec 21, 2015

Member

I’m not sure.
• If you mean how it’s doing the referencing, I’m still not sure.
• If you mean it’s not referencing anything but that I’m saying that it is, then I’m confused.

../lib/libevent/include/
)
# Probably not the recommended method, but other ways don't seem to generate libraries in libs/armeabi

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Move libs after build?

@worktycho

worktycho Dec 20, 2015

Member

Move libs after build?

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

ehhh naah 😊

@tigerw

tigerw Dec 21, 2015

Member

ehhh naah 😊

add_library(AndroidNative jni/app-android.cpp)
add_dependencies(tolua_native lua_native)
add_dependencies(AndroidNative tolua_native)

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Why does the androidNative lib depend on tolua_native?

@worktycho

worktycho Dec 20, 2015

Member

Why does the androidNative lib depend on tolua_native?

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

I thought it was more like tolua_native depended on AndroidNative. My intention was to get tolua_native and lua_native to actually build.

@tigerw

tigerw Dec 21, 2015

Member

I thought it was more like tolua_native depended on AndroidNative. My intention was to get tolua_native and lua_native to actually build.

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Then you should add a dependency on tolua_native in src/Bindings/CmakeLists.txt

@worktycho

worktycho Dec 21, 2015

Member

Then you should add a dependency on tolua_native in src/Bindings/CmakeLists.txt

@@ -453,7 +453,12 @@ class cClientHandle // tolua_export
// TODO: Add Kicking here as well
} ;
#ifdef ANDROID
#pragma message "Android <atomic> support is incomplete or broken - using plain variable (subject to data races!)"
eState m_State;

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

This is not an acceptable solution. If we can't use std::atomic, then we need to setup typedefs to a custom std::atomic implementation using cCriticalSection.

@worktycho

worktycho Dec 20, 2015

Member

This is not an acceptable solution. If we can't use std::atomic, then we need to setup typedefs to a custom std::atomic implementation using cCriticalSection.

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

nooooooooooooo

@tigerw

tigerw Dec 21, 2015

Member

nooooooooooooo

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Unless you want to review all the code that uses std::atomic, and come up with alternative implementations, I think a custom minimal atomic implementation is easier.

@worktycho

worktycho Dec 21, 2015

Member

Unless you want to review all the code that uses std::atomic, and come up with alternative implementations, I think a custom minimal atomic implementation is easier.

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

I don't think you should be bothered about this, considering it may well be fixed anyway in future NDK releases and Android runs at 0.8 chunks per second and so is unlikely to be used as an actual server. I definitely don't have the time to try and re-implement atomic :P

@tigerw

tigerw Dec 21, 2015

Member

I don't think you should be bothered about this, considering it may well be fixed anyway in future NDK releases and Android runs at 0.8 chunks per second and so is unlikely to be used as an actual server. I definitely don't have the time to try and re-implement atomic :P

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

As I said, if thread safety is less important than performance, you should make cCriticalSection a noop. A minimal std::atomic implantation using cCriticalSection would not be much work. It doesn't need to be fully standard complaint, just provide the interfaces we use.

@worktycho

worktycho Dec 21, 2015

Member

As I said, if thread safety is less important than performance, you should make cCriticalSection a noop. A minimal std::atomic implantation using cCriticalSection would not be much work. It doesn't need to be fully standard complaint, just provide the interfaces we use.

#define ATTRIBUTE_TLS static __thread
#if defined (ANDROID)
// Tycho: I'm sorry, I'm sorry, I'm so, so, sorry, but please blame the NDK developers for lack of, thread_local
#define ATTRIBUTE_TLS static

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Really? What about __thread?

@worktycho

worktycho Dec 20, 2015

Member

Really? What about __thread?

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

Apparently only GCC emulates thread local storage and not Clang (yet), but GCC crashes when compiling Lua.

Also, imagining your expression when you read the downgrading of TLS to just the plain static, and then saying, "really?", makes me laugh :P

@tigerw

tigerw Dec 21, 2015

Member

Apparently only GCC emulates thread local storage and not Clang (yet), but GCC crashes when compiling Lua.

Also, imagining your expression when you read the downgrading of TLS to just the plain static, and then saying, "really?", makes me laugh :P

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Just leaving it as a static is UB so not really an option. So we either need to use atomics (is this possible on android?), the pthread thread local api (slow), or work out some way of using a mutex (slow).

@worktycho

worktycho Dec 21, 2015

Member

Just leaving it as a static is UB so not really an option. So we either need to use atomics (is this possible on android?), the pthread thread local api (slow), or work out some way of using a mutex (slow).

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

(They are working on TLS support for Clang.)

Unless someone is actually really in need of running a reliable server on their phone, it doesn't matter in my humble opinion.

@tigerw

tigerw Dec 21, 2015

Member

(They are working on TLS support for Clang.)

Unless someone is actually really in need of running a reliable server on their phone, it doesn't matter in my humble opinion.

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Why not just replace cCriticalSection with a noop? It will offer a major performance boost on these low power devices? Because we need thread safety. Any instance of a race condition is grounds for the compiler to do whatever it feels like.

@worktycho

worktycho Dec 21, 2015

Member

Why not just replace cCriticalSection with a noop? It will offer a major performance boost on these low power devices? Because we need thread safety. Any instance of a race condition is grounds for the compiler to do whatever it feels like.

This comment has been minimized.

@tigerw

tigerw Dec 27, 2015

Member

I am intending for this to be an experimental thing. Of course there will be bugs, but there are loads of them anyway, and the compiler doesn't seem to be doing anything untoward.

In an ideal situation, everything would be standards compliant, but since I've no time to reimplement nor wish to pollute the main repository with more Android artefacts, it's gonna be a case of buggy mobile builds versus none at all.

Does that sit comfortable on your conscience??

...unless you want to do something code-y about it?

On 21 Dec 2015, at 17:28, "worktycho" notifications@github.com wrote:

In src/FastRandom.cpp:

@@ -8,8 +8,11 @@

#include

-#if defined (GNUC)

  • #define ATTRIBUTE_TLS static __thread
    +#if defined (ANDROID)
  • // Tycho: I'm sorry, I'm sorry, I'm so, so, sorry, but please blame the NDK developers for lack of, thread_local
  • #define ATTRIBUTE_TLS static
    Why not just replace cCriticalSection with a noop? It will offer a major performance boost on these low power devices? Because we need thread safety. Any instance of a race condition is grounds for the compiler to do whatever it feels like.


Reply to this email directly or view it on GitHub.

@tigerw

tigerw Dec 27, 2015

Member

I am intending for this to be an experimental thing. Of course there will be bugs, but there are loads of them anyway, and the compiler doesn't seem to be doing anything untoward.

In an ideal situation, everything would be standards compliant, but since I've no time to reimplement nor wish to pollute the main repository with more Android artefacts, it's gonna be a case of buggy mobile builds versus none at all.

Does that sit comfortable on your conscience??

...unless you want to do something code-y about it?

On 21 Dec 2015, at 17:28, "worktycho" notifications@github.com wrote:

In src/FastRandom.cpp:

@@ -8,8 +8,11 @@

#include

-#if defined (GNUC)

  • #define ATTRIBUTE_TLS static __thread
    +#if defined (ANDROID)
  • // Tycho: I'm sorry, I'm sorry, I'm so, so, sorry, but please blame the NDK developers for lack of, thread_local
  • #define ATTRIBUTE_TLS static
    Why not just replace cCriticalSection with a noop? It will offer a major performance boost on these low power devices? Because we need thread safety. Any instance of a race condition is grounds for the compiler to do whatever it feels like.


Reply to this email directly or view it on GitHub.

// There is a problem here on Android. Text files transferred from another OS may have a newline representation Android's implementation of getline doesn't expect
// Thus, part of a newline may be left in ParsingLine. ::empty() thus thinks the string isn't empty, and the below code outputs interesting errors since it was passed a nearly empty string
// Ref: http://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf
// TODO: There is a solution in the above reference, but it isn't very pretty. Fix it somehow.

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Solution: Don't build on windows 😄 , but seriously, I'd say that we should use the wrapper from the question if it wasn't for licensing issues. The other short term option is to just tell anyone building the android app on window to set git to use unix line endings. Most text editors can handle it.

@worktycho

worktycho Dec 20, 2015

Member

Solution: Don't build on windows 😄 , but seriously, I'd say that we should use the wrapper from the question if it wasn't for licensing issues. The other short term option is to just tell anyone building the android app on window to set git to use unix line endings. Most text editors can handle it.

@@ -295,6 +297,27 @@ std::unique_ptr<cLogger::cListener> MakeConsoleListener(bool a_IsService)
////////////////////////////////////////////////////////////////////////////////
// cFileListener:
#if defined (ANDROID)

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Create a separate listener.

@worktycho

worktycho Dec 20, 2015

Member

Create a separate listener.

This comment has been minimized.

@tigerw

tigerw Dec 21, 2015

Member

awww, do I have to

@tigerw

tigerw Dec 21, 2015

Member

awww, do I have to

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Yes.

@worktycho
elseif(ANDROID)
# Android has neither pthread nor rt
target_link_libraries(OSSupport)
else()
target_link_libraries(OSSupport rt)

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Everyone needs event_core and event_extra

@worktycho

worktycho Dec 20, 2015

Member

Everyone needs event_core and event_extra

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

And not apple needs pthread.

@worktycho

worktycho Dec 20, 2015

Member

And not apple needs pthread.

#elif defined(ANDROID)
// Identical to Linux below, but st_mtime is an unsigned long, so cast is needed:
auto Time = static_cast<time_t>(st.st_mtime);
return static_cast<unsigned>(mktime(localtime(&Time)));

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

Why not just change the general linux code to be this?

@worktycho

worktycho Dec 20, 2015

Member

Why not just change the general linux code to be this?

This comment has been minimized.

@tigerw

tigerw Dec 20, 2015

Member

Do compilers complain if you cast to the same type?

@tigerw

tigerw Dec 20, 2015

Member

Do compilers complain if you cast to the same type?

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

I don't think so. But test it.

@worktycho

worktycho Dec 21, 2015

Member

I don't think so. But test it.

#include <IPHlpApi.h>
#pragma comment(lib, "IPHLPAPI.lib")
#else // _WIN32
#elif !defined(ANDROID) // _WIN32
#include <sys/types.h>

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

How are you including networking headers on andriod?

@worktycho

worktycho Dec 20, 2015

Member

How are you including networking headers on andriod?

This comment has been minimized.

@tigerw

tigerw Dec 20, 2015

Member

Liberal application of magic.

@tigerw

tigerw Dec 20, 2015

Member

Liberal application of magic.

This comment has been minimized.

@worktycho

worktycho Dec 21, 2015

Member

Meaning? Is it just that this file isn't actually doing anything?

@worktycho

worktycho Dec 21, 2015

Member

Meaning? Is it just that this file isn't actually doing anything?

@@ -121,7 +121,7 @@ AStringVector cNetwork::EnumLocalIPAddresses(void)
{
AStringVector res;

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

So you're just breaking this function on android?

@worktycho

worktycho Dec 20, 2015

Member

So you're just breaking this function on android?

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

If you are going to break it, at least update the API docs.

@worktycho

worktycho Dec 20, 2015

Member

If you are going to break it, at least update the API docs.

@@ -584,7 +584,7 @@ void cMojangAPI::SaveCachesToDisk(void)
try
{
// Open up the SQLite DB:
SQLite::Database db("MojangAPI.sqlite", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
SQLite::Database db(FILE_IO_PREFIX "MojangAPI.sqlite", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);

This comment has been minimized.

@worktycho

worktycho Dec 20, 2015

Member

What about the SQLite lua bindings? Don't they need the prefix as well?

@worktycho

worktycho Dec 20, 2015

Member

What about the SQLite lua bindings? Don't they need the prefix as well?

@Schwertspize

This comment has been minimized.

Show comment
Hide comment
@Schwertspize

Schwertspize Apr 24, 2016

Contributor

@tigerw I would recommend that you keep this one closed, re-write your branch to not generate an apk, instead binaries, the NDK can do that 😛. Then open a new pr

Contributor

Schwertspize commented Apr 24, 2016

@tigerw I would recommend that you keep this one closed, re-write your branch to not generate an apk, instead binaries, the NDK can do that 😛. Then open a new pr

tigerw added a commit to cuberite/lua that referenced this pull request May 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment