fix endif syntax of each ifdef and ifndef conditions