Your concept is completely right and there is nothing wrong with the code, except of the missing semicolon at the end.
It compiles fine here and works like expected, so you probably just redefined something existing or did some other things wrong? The Lite-C compiler isn't a real help when trying to track down the correct line which causes the error.