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

Replaced procfs dependent functions with native calls on OS X. #87 #125

Merged
merged 3 commits into from May 22, 2014
Merged

Conversation

JanSimek
Copy link

I started replacing functions in linux_main.cpp which rely on procfs with OS X native calls and separating the two by #ifdefs

In the end it looked really confusing, so I decided to move all the common functions into posix_main.cpp and separate platform specific ones into platform_linux.cpp and platform_osx.mm (contains objective-c++ code). It's not finished, it's not tested on linux and it breaks clang build (gcc compilation works) with this error:

error: Objective-C 1 was disabled in PCH file but is currently enabled

I wasn't sure if you were going to like this solution, so I submitted this pull request first before working on it further.

@RobertBeckebans
Copy link
Owner

Is Objective-C++ really necessary? I personally hate all that
Objective-C/C++ stuff and don't want to merge it if it isn't absolutely
necessary.

2014-05-21 23:38 GMT+02:00 Radegast notifications@github.com:

I started replacing functions in linux_main.cpp which rely on procfs with
OS X native calls and separating the two by #ifdefs

In the end it looked really confusing, so I decided to move all the common
functions into posix_main.cpp and separate platform specific ones into
platform_linux.cpp and platform_osx.mm (contains objective-c++ code).
It's not finished, it's not tested on linux and it breaks clang build (gcc
compilation works) with this error:

error: Objective-C 1 was disabled in PCH file but is currently enabled

I wasn't sure if you were going to like this solution, so I submitted this

pull request first before working on it further.

You can merge this Pull Request by running

git pull https://github.com/JanSimek/RBDOOM-3-BFG objective-c

Or view, comment on, or merge it at:

#125
Commit Summary

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/125
.

@JanSimek
Copy link
Author

It's not absolutely necessary. There is just no native C++ function for finding user's Application Support path, so I hard coded it to sprintf( savepath, "%s/Library/Application Support/rbdoom3bfg", getenv( "HOME" ) ); which will work until Apple changes that location. So now it compiles with both gcc and clang and there is no objective-c++ code anymore.

@DanielGibson
Copy link

Does this maybe help?
https://wiki.libsdl.org/SDL_GetPrefPath

@JanSimek
Copy link
Author

Yes! That works.

RobertBeckebans added a commit that referenced this pull request May 22, 2014
Replaced procfs dependent functions with native calls on OS X. #87
@RobertBeckebans RobertBeckebans merged commit 0f1f22d into RobertBeckebans:master May 22, 2014
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.

None yet

3 participants