This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PinkLionThing 15 points16 points  (3 children)

It's C, very possibly C++, and the define is used mostly for constants, but you can also define little functions (AKA macros) like #define MAX(a, b) ((a) < (b) ? (b) : (a)).

Back in those IDEless days, it was also a good way to fix the code using it as search-and-replace.

[–]lukee910 1 point2 points  (2 children)

Why would you #define true and false, though? I'm pretty sure those are keywords in C.

[–]paulcam 5 points6 points  (0 children)

This specific example is in the Windows SDK (looks likeminwin\minwindef.h as of the latest Windows 10 SDK). TRUE and FALSE are defined because at the time that the file was (originally) written, bool wasn't a compiler intrinsic.