The forum is being replaced with new software. Please use the replacement hosted at https://forum.angband.live/ in the meantime. These forums will stay open until migrating old topics can be achieved, though posting will eventually be locked. Thankyou for your patience.

MSVC doesn't like identify.c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ekolis
    Knight
    • Apr 2007
    • 825

    MSVC doesn't like identify.c

    Hmm, spent a bit of time piecing this together, seeing as I don't know much about C... but apparently, identify.c from r1622 won't compile in MSVC - for some reason, you have to have all your variable declarations up at the top of the function before you do anything else, and object_notice_ego was violating this rule! Changing this allowed the game to compile, though. Just thought I'd let you know
    You read the scroll labeled NOBIMUS UPSCOTI...
    You are surrounded by a stasis field!
    The tengu tries to teleport, but fails!
  • zaimoni
    Knight
    • Apr 2007
    • 551

    #2
    Originally posted by ekolis
    Hmm, spent a bit of time piecing this together, seeing as I don't know much about C... but apparently, identify.c from r1622 won't compile in MSVC - for some reason, you have to have all your variable declarations up at the top of the function before you do anything else, and object_notice_ego was violating this rule! Changing this allowed the game to compile, though. Just thought I'd let you know
    C89 requires all variable declarations up at the top of the function before doing anything else.

    C99 follows C++ in this regard.
    Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
    Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
    Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎
    MMOMBuy POE 2 Currency