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

Build under MSVC 14 #10714

Merged
merged 10 commits into from Jan 5, 2015

Conversation

Projects
None yet
4 participants
@bkentel
Copy link
Contributor

commented Jan 2, 2015

Various (incomplete) changes that allow MSVC to build the non-localized SDL tiles version.

  • The strings in src/options.cpp were causing issues, so I changed some to raw-string literals.
  • [CR] I couldn't test the changes I made to src/debug.cpp -- if anyone would be so kind as to compile the changes.
  • [WIP] The project files still need to be cleaned up for brevity, consistency, and correctness for all build configurations, but for now "Debug TILES" builds and runs.

bkentel added some commits Jan 2, 2015

Build under MSVC 14
Various (incomplete) changes that allow MSVC to build the non-localized
SDL tiles version.
current->tm_hour
, current->tm_min
, current->tm_sec
, static_cast<int>(tv.tv_usec / 1000 + 0.5)

This comment has been minimized.

Copy link
@BevapDin

BevapDin Jan 2, 2015

Contributor

Are you sure, this works as you intended it?
tv_usec is probably some kind an integer (not a floating point value), tv.tv_usec / 1000 is an integer as well (the division discards the remainder). tv.tv_usec / 1000 + 0.5 is now a proper floating point value, but is immediately converted back to an integer, losing the 0.5. In other words: the static_cast is always applied to something with .5 as fractional part.

This comment has been minimized.

Copy link
@bkentel

bkentel Jan 3, 2015

Author Contributor

I took the code as written -- looking at it again, it's a bit odd isn't it;

static_cast<int>(tv.tv_usec / 1000.0 + 0.5);

would be more sane I'll change it.

@bkentel

This comment has been minimized.

Copy link
Contributor Author

commented Jan 3, 2015

Updating the project files should be finished now with 696dc99.

@bkentel

This comment has been minimized.

Copy link
Owner Author

commented on src/advanced_inv.cpp in 152d16d Jan 3, 2015

MSVC 14 still has problems with initializer lists in some places -- this should be a portable fix.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 3, 2015

Stuck in airports all day today and tomorrow, with luck I can look at this
Sunday.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2015

Ugh. Hoping the airports are comfy at least.

@@ -663,6 +663,10 @@ void load_colors(JsonObject &jsobj)
#define ccolor(s) consolecolors[s][0],consolecolors[s][1],consolecolors[s][2]
int curses_start_color(void)
{
//TODO: this function strikes terror into my very soul...

This comment has been minimized.

Copy link
@kevingranade

kevingranade Jan 4, 2015

Member

Snarky comments about the function are not a valid comment, please remove.

};

#ifdef _MSC_VER
inline time_info get_time() noexcept {

This comment has been minimized.

Copy link
@kevingranade

kevingranade Jan 4, 2015

Member

Avoid inline, the compiler has more information than you do to make that decision. Also if it's not used elsewhere, please declare it static.

This comment has been minimized.

Copy link
@bkentel

bkentel Jan 4, 2015

Author Contributor

fair enough -- is that general policy when it isn't critical to force inline i.e. with __attribute__((always_inline))?

@@ -0,0 +1,103 @@
#pragma once

This comment has been minimized.

Copy link
@kevingranade

kevingranade Jan 4, 2015

Member

Normally I don't care what you're doing in the visual studio project file directory, but what the hell is this? Why does visual studio need to shotgun include what looks like half or more of the standard library?

This comment has been minimized.

Copy link
@bkentel

bkentel Jan 4, 2015

Author Contributor

precompiled headers; only (simple) way to improve build speed with MSVC.
regardless, this header is only pulled in by the MSVC build and lives outside src/ (inside msvc140/).

This comment has been minimized.

Copy link
@kevingranade

kevingranade Jan 5, 2015

Member

Ok, my bad, that's a totally reasonable thing to do :)

@kevingranade kevingranade self-assigned this Jan 5, 2015

@kevingranade kevingranade merged commit 74f5b64 into CleverRaven:master Jan 5, 2015

1 check passed

default
Details

@bkentel bkentel deleted the bkentel:dev branch Jan 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.