Author Topic: Open Curly Brace doesn't work in Mac OS X 10.9  (Read 7995 times)

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Open Curly Brace doesn't work in Mac OS X 10.9
« Reply #15 on: July 13, 2015, 02:51:44 pm »
Thinking that it has something to do with the precompiled headers. Try configure with --disable-pch.

(https://gist.github.com/juanfal/6d2baa88e31ea9f0a0c1)
Code: [Select]
In file included from ../../../src/include/sdk.h:17:
In file included from ../../../src/include/sdk_precomp.h:13:
In file included from ../../../src/include/sdk_common.h:43:
../../../src/include/prep.h:33:75: error: use of overloaded operator '==' is ambiguous (with operand types 'const std::__1::shared_ptr<GDBWatch>' and
      'int')
        template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
                                                                      ~~~ ^  ~

You might also want to configure with --enable-std_string when compiling wxWidgets with clang++.


See also http://sourceforge.net/p/codeblocks/tickets/13/
(it contains some more details, from the macports port)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Open Curly Brace doesn't work in Mac OS X 10.9
« Reply #16 on: July 13, 2015, 07:03:59 pm »
What happens if you try this patch?

Code: Diff
  1. diff --git a/src/include/prep.h b/src/include/prep.h
  2. index 7e114a0..81fbf86 100644
  3. --- a/src/include/prep.h
  4. +++ b/src/include/prep.h
  5. @@ -17,8 +17,17 @@
  6.      #define __has_feature(x) 0
  7.  #endif
  8.  
  9. -#if    !(((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) && defined __GXX_EXPERIMENTAL_CXX0X__) \
  10. -    && !(defined(__clang__) && __has_feature(cxx_nullptr))
  11. +#if __cplusplus>=201103L
  12. +    #define CB_HAS_NULLPTR 1
  13. +#elif ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) && defined __GXX_EXPERIMENTAL_CXX0X__
  14. +    #define CB_HAS_NULLPTR 1
  15. +#elif defined(__clang__) && __has_feature(cxx_nullptr)
  16. +    #define CB_HAS_NULLPTR 1
  17. +#else
  18. +    #define CB_HAS_NULLPTR 0
  19. +#endif
  20. +
  21. +#if CB_HAS_NULLPTR!=1diff --git a/src/include/prep.h b/src/include/prep.h
  22. index 7e114a0..81fbf86 100644
  23. --- a/src/include/prep.h
  24. +++ b/src/include/prep.h
  25. @@ -17,8 +17,17 @@
  26.      #define __has_feature(x) 0
  27.  #endif
  28.  
  29. -#if    !(((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) && defined __GXX_EXPERIMENTAL_CXX0X__) \
  30. -    && !(defined(__clang__) && __has_feature(cxx_nullptr))
  31. +#if __cplusplus>=201103L
  32. +    #define CB_HAS_NULLPTR 1
  33. +#elif ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) && defined __GXX_EXPERIMENTAL_CXX0X__
  34. +    #define CB_HAS_NULLPTR 1
  35. +#elif defined(__clang__) && __has_feature(cxx_nullptr)
  36. +    #define CB_HAS_NULLPTR 1
  37. +#else
  38. +    #define CB_HAS_NULLPTR 0
  39. +#endif
  40. +
  41. +#if CB_HAS_NULLPTR!=1
  42.      // it is a const object...
  43.      const class nullptr_t
  44.      {
  45.  
  46.      // it is a const object...
  47.      const class nullptr_t
  48.      {
  49.  

Also what c++ stdlib are you using - libc++ or libstdc++?
The former is the only way to get c++11 features on osx as far as I know and also it is always building in c++11 mode.

Mixing the two is probably bad idea. Also I think people building on OSX should try to use libc++, c++11 and wxCocoa-3.x.
Trying to use the old wx is a waste of time in my opinion.

And lastly cb core seems to build fine with gcc-4.8.5, -std=c++11 and no -ansi flag (passing -ansi and -std=c++11, causes lots of problems).
« Last Edit: July 13, 2015, 07:27:39 pm by jens »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Open Curly Brace doesn't work in Mac OS X 10.9
« Reply #17 on: August 04, 2015, 10:32:03 pm »
Has anyone tried my patch?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Stashue

  • Single posting newcomer
  • *
  • Posts: 3
Re: Open Curly Brace doesn't work in Mac OS X 10.9
« Reply #18 on: February 12, 2019, 07:03:00 pm »
So what is the final solution to the problem with the braces?  I didn't understand

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11821
    • Travis build status
Re: Open Curly Brace doesn't work in Mac OS X 10.9
« Reply #19 on: February 12, 2019, 08:48:19 pm »
Have you tried the latest night build? See the night build subforum. There are new builds.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]