I assume he meant what version of Arduino core code and libraries is being used.
For that, as long as the IDE is being used to build the image, you can look at the define ARDUINO.
Well unless you are unlucky enough to have revisions in the 0016 to 0018 range
in which case the ARDUINO define was messed up and stuck at 0016.
to check for pre 1.0 and post 1.0 you can use:
#if ARDUINO < 100
// pre 1.0 code here
//post 1.0 code here
For the board, what is usually more important is to know the core or "variant" being using.
And what is truely sad is that (at least with post 1.0) the IDE knows both the core and the variant because it is is specified
in the boards.txt file, but neither the IDE nor the variant header files bother to set any type of define
to let the code being compiled to know about it.
So it is very difficult to tell what board/core/variant is being used. To fully qualify a board you not only have
to look at the processor type as Coding Badly pointed out but you have to potentially also look around at
some other defines as well.
This is because there are multiple boards that can use the same processor that can use different cores or different pinouts.
Examples of this are Teensy vs Leonardo
Sanguino vs BobDuino, vs Mighty 1284p.
While it is possible to be able to determine a board type/variant at compile time, it isn't as simple as just looking at processor type.
Currently it is a PITA as depending on the processor type you sometimes also have to look around for some
unique defines in that core/variant files to help figure out the variant as well.
This can be a special define that is unique (this works for Teensy) or you can peek into pin mapping defines by checking things like
pwm support on pins or analog to digital pin number mappings which works for the Sanguino, et al boards.