I don't think this will support half, since it doesn't include half.h.
Just add #include <OpenEXR/half.h> at the top, and get rid of the ifdef.