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

CppLib::setActiveHandle caused compiler error [macOS Catalina] #278

Open
JotaroS opened this issue Nov 14, 2019 · 4 comments
Open

CppLib::setActiveHandle caused compiler error [macOS Catalina] #278

JotaroS opened this issue Nov 14, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@JotaroS
Copy link
Collaborator

JotaroS commented Nov 14, 2019

Hi,
I wanted to build shared library for seiral, and the compiler error happened at L23-25 of lib.cpp. Working branch is unity.

void CppLib::setActiveHandle(uint64_t handle)
{
    s_handle = (void *) handle; //replacing void * to FILEHANDLE fixed the compiler problem
}

compiler error was

/Users/jotaro/dualpantoframework/utils/serial/src/cppLib/lib.cpp:25:16: error: assigning to 'FILE *' (aka '__sFILE *') from incompatible type 'FILE **' (aka '__sFILE **'); dereference with *
    s_handle = (FILEHANDLE *) handle;

does this happen to other environment?

@JotaroS JotaroS added the bug Something isn't working label Nov 14, 2019
@Ferandal
Copy link
Collaborator

This is an issue with how the operating systems handle Filehandles
The current version is how Windows requires it (I decided to leave it so, because unity is oriented for windows machines)
MacOS and Linux require void pointer as you noticed

@Ferandal
Copy link
Collaborator

The right solution would be to automatically detect on which operating system the build is beeing done and load the right code

@JotaroS
Copy link
Collaborator Author

JotaroS commented Nov 21, 2019

ok, so this should look like this:

void CppLib::setActiveHandle(uint64_t handle)
{
    #if __APPLE__
    s_handle = (FILEHANDLE) handle;
    #elif _WIN32
    s_handle = (void *) handle;
    #endif
}

Should this be for unity branch or develop branch?

@JotaroS
Copy link
Collaborator Author

JotaroS commented Dec 12, 2019

@Ferandal any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants