MSVC doesn't like identify.c

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

    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
    • 590

    #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...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎