Download Handel-C Language Reference Manual
Transcript
Handel-C Language Reference Manual i = million (3); is expanded into: i = 3e6; Take care when specifying parameters. In the example above, if 3e6 was passed instead of 3, then the line would be expanded into: i = 3e6e6; which would result in an error. 13.6 Error generation Fatal error messages may be reported during preprocessing using the directive: #error error_message This may be useful with conditional compilation if your design only supports certain combinations of parameter definitions. 13.7 Predefined macro substitution The preprocessor contains a number of useful predefined macros which may be placed into source code: _ _FILE_ _ Expands to the name of the current file being compiled _ _LINE_ _ Expands to the number of the current source line _ _TIME_ _ Expands to the current time of compilation in the form hh:mm:ss _ _DATE_ _ Expands to the current date of compilation in the form mmm dd yyyy 13.8 Line splicing You can splice multiple lines together by placing a backslash character (‘\’) followed by a carriage return between them. This feature allows you to break lines for aesthetic purposes when writing code, which are then joined by the preprocessor prior to compilation. For example, if a macro is defined: #define ERRORCHECK(error) if (error!=0) return (error) \ \ The line: www.celoxica.com Page 314