Jump to content


Oliver on Civ IV Tech


  • Please log in to reply
No replies to this topic

#1 IMG News

IMG News

    Pimpbot 4000

  • IMG Writers
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 7112 posts
  • Pro Member:Yes

Posted 10 March 2006 - 10:33 AM

Our favorite Mac coder Brad Oliver takes a break while the latest build of Civilization IV compiles to pontificate on the travails of porting windows code to the Mac. Those who know nothing of coding, beware: what follows is not for the faint of heart.

Things get weird when you use the wchar variants, like wprintf. The standard states that, essentially, wprintf takes the same formatting tokens as the printf case: %s for char strings, %ls or %S for wchar strings. Visual Studio, however, does the exact opposite. in wprintf, it uses %s to represent wchar strings, and %S to represent regular char strings. Worse, they've added the notion of %hs to also represent regular char strings in a wprintf statement.
It's true Brad style all the way. For the full scoop, head over to The Brad Hole and take in the whole post.
Return to Full Article - InsideMacGames News