Try replacing the line
#ifdef __cplusplus}
with
#ifdef __cplusplus
}

You are giving an opening { when __cplusplus but not the closing one } for the same I guess.