aliens

Author Topic: Build fix for OSX 10.9  (Read 17566 times)

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Build fix for OSX 10.9
« Reply #15 on: April 09, 2014, 10:57:09 am »
diff --git a/src/Interface/TextList.cpp b/src/Interface/TextList.cpp
index 58adef3..f76de21 100644
--- a/src/Interface/TextList.cpp
+++ b/src/Interface/TextList.cpp
@@ -570,7 +570,7 @@ void TextList::setCondensed(bool condensed)
  */
 int TextList::getSelectedRow() const
 {
-       int selRow = std::min(_selRow, _rows.size());
+       int selRow = std::min(_selRow, (unsigned)_rows.size());
        return _rows[selRow];
 }
 
fixes the compilation.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Build fix for OSX 10.9
« Reply #16 on: April 09, 2014, 08:42:50 pm »
But size_t's are always unsigned. ???

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Build fix for OSX 10.9
« Reply #17 on: April 09, 2014, 10:15:05 pm »
i think it may be because it's comparing an unsigned int to an unsigned long, and can't match a <template>(T, T).  casting the long to unsigned (that is, unsigned int) will make them the same bit size and match the template.

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Build fix for OSX 10.9
« Reply #18 on: April 09, 2014, 10:16:41 pm »
Not always 32bit in size, however ;-)

The OSX builds are 64bit, and therefore would have a 64bit size_t type

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Build fix for OSX 10.9
« Reply #19 on: April 09, 2014, 10:28:24 pm »
Good catch. I've replaced "unsigned int" with "size_t" where relevant.

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Build fix for OSX 10.9
« Reply #20 on: April 10, 2014, 10:10:23 am »
One more;

Basescape/MiniBaseView.cpp:84:20: error: out-of-line definition of 'setSelectedBase' does not match any declaration in 'OpenXcom::MiniBaseView'
void MiniBaseView::setSelectedBase(unsigned int base)
                   ^~~~~~~~~~~~~~~

diff --git a/src/Basescape/MiniBaseView.cpp b/src/Basescape/MiniBaseView.cpp
index 0dbbce3..2c797f4 100644
--- a/src/Basescape/MiniBaseView.cpp
+++ b/src/Basescape/MiniBaseView.cpp
@@ -81,7 +81,7 @@ size_t MiniBaseView::getHoveredBase() const
  * the mini base view.
  * @param base ID of base.
  */
-void MiniBaseView::setSelectedBase(unsigned int base)
+void MiniBaseView::setSelectedBase(size_t base)
 {
        _base = base;
        _redraw = true;

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Build fix for OSX 10.9
« Reply #21 on: April 10, 2014, 02:47:51 pm »
Should be fixed.

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Build fix for OSX 10.9
« Reply #22 on: April 10, 2014, 06:45:30 pm »
@grrussel: check out https://github.com/SupSuper/OpenXcom/pulls?direction=desc&page=1&sort=created&state=open for submitting pull requests.  it's easier on the devs than posting diffs in the forums, and the diffs will stay up to date even when surrounding code changes.
« Last Edit: April 10, 2014, 06:47:03 pm by myk002 »

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Build fix for OSX 10.9
« Reply #23 on: April 30, 2014, 02:23:18 pm »
The makefile.simple no longer specifies a default target of OSX, so the OSX autobuilder got broken.

Now, the makefile can detect OSX automatically, se

https://gist.github.com/anonymous/626242249065b31f39d9

for the 3 line patch.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Build fix for OSX 10.9
« Reply #24 on: April 30, 2014, 07:18:53 pm »
Added. I removed the OSX by default because some Linux users also use that Makefile and it threw them off :P