Opened 8 years ago

Closed 8 years ago

#51838 closed defect (fixed)

gnome-sudoku build error on OSX 10.5.8 intel (i386)

Reported by: arboz@… Owned by: dbevans (David B. Evans)
Priority: Low Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: gnome-sudoku

Description

This is very small and easy to fix.

Error occurs while compiling lib/qqwing-wrapper.cpp

Probably if using later std lib there will be no issue

qqwing-wrapper.cpp: In function ‘int* qqwing_generate_puzzle(int)’:
qqwing-wrapper.cpp:50: error: ‘nullptr’ was not declared in this scope
make[1]: *** [libsudoku_la-qqwing-wrapper.lo] Error 1

nullptr is not defined, however NULL is a macro which returns a null ptr

so line 50 needs to change to:

50c50
<         srand(time(nullptr));
---
>         srand(time(NULL));

example diff file attached

Attachments (1)

qqwing-wrapper_cpp.diff (466 bytes) - added by arboz@… 8 years ago.
change nullptr to NULL

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by arboz@…

Attachment: qqwing-wrapper_cpp.diff added

change nullptr to NULL

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Keywords: build error removed
Owner: changed from macports-tickets@… to devans@…

In the future, please Cc the port maintainers (port info --maintainers gnome-sudoku), if any. Per the guidelines, please instead attach the patchfile as a unified diff.

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Keywords: build error removed
Owner: changed from macports-tickets@… to devans@…

In the future, please Cc the port maintainers (port info --maintainers gnome-sudoku), if any. Per the guidelines, please instead attach the patchfile as a unified diff.

comment:2 Changed 8 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

This problem was the result of a conscious decision upstream to start using C++11 language features (such as nullptr) in this application. The effect for us was to break the build on OS X versions which use libstdc++ by default (10.8 and earlier). The build was successful for 10.9+ where libc++ is the default.

Due to many reports of breakage with older compilers similar to this one, version 3.20.4 has been released which backs out this change for the duration of the 3.20 stable release branch.

Note, however, that the move to C++11 is continuing in upstream master (and elsewhere in GNOME) so we can probably expect to see this issue revisited with the 3.22 stable release. If you're not willing or not able to upgrade to a later version of OS X (10.9+) you might want to look at LibcxxOnOlderSystems for ideas on how to work around this issue on older systems.

Fixed (temporarily) by the upgrade to gnome-sudoku 3.20.4 in r150284. Builds on 10.6+ and hopefully 10.5 as well.

Note: See TracTickets for help on using tickets.