Fix compilation by undef-ing a few things if they're defined

Change-Id: I9d551e5f9cb59511c78001ca1c815053d0ded2f9