Giter VIP home page Giter VIP logo

Comments (6)

minggo avatar minggo commented on May 21, 2024

Did you mean that, less function should be put into namespace cocos2d?
cocos2d-x don't support Mac OS X, so you port it to Mac OS X?

from cocos2d-x.

minggo avatar minggo commented on May 21, 2024

Do you mind posting issues in official forum later?
The link is http://www.cocos2d-x.org/projects/cocos2d-x/boards.

Thank you.

from cocos2d-x.

qbit86 avatar qbit86 commented on May 21, 2024

Did you mean that, less function should be put into namespace cocos2d?

No fear, it's one-time function (as far as I understood), it should not pollute API namespace, it should be only accessible in that compilation unit.

I placed it into anonymous namespace, because it's (according to Stroustrup) preferred way to restrict function visibility:
“The use of the static keyword is deprecated when declaring objects in a namespace scope, the unnamed-namespace provides a superior alternative.”

cocos2d-x don't support Mac OS X, so you port it to Mac OS X?

No, I just building under Mac OS X targeting iOS 4.3. I've got a compilation error on XCode, but everything is OK on MSVS 2010 under Windows. There are actually some differences in #include'ing headers of “stable” libraries (Cocos2d-x, Loki, Boost, STL) in precompiled header in Visual C++ and prefix header in XCode.

from cocos2d-x.

qbit86 avatar qbit86 commented on May 21, 2024

Probable steps to reproduce (have not checked yet):

  1. Create XCode project with Cocos2d-x template. Source code of Cocos2d-x will be included in xcodeproj directly. Therefore prefix header will be implicitly added to every compilation unit.
  2. Edit Prefix.pch:
#ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
#elif defined __cplusplus
    #include <functional>
#endif
  1. Try to build.

from cocos2d-x.

donaldalanmorrison avatar donaldalanmorrison commented on May 21, 2024
@Qbit86 : That PCH file is incorrect.  Both __OBJC__ and __cplusplus are both defined when a .cpp or .mm file is compiled. 
In other words, the conditions should be nested, instead of being disjunct.

from cocos2d-x.

godyZ avatar godyZ commented on May 21, 2024

@qbit86 Please, could you open a bug in redmine in future? We are in process of migrating all the issues to redmine and github issue won't be available after August

from cocos2d-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.