- Pseudo subroutines with macros - 4 Updates
- "ChattyG takes a college freshman C/C++ programming exam" - 12 Updates
- BUY 2C-B PELLETS WITH BITCOIN ONLINE - 1 Update
- MOST EFFECTIVE ALBINO PENIS ENVY-PSILOCYBIN MAGIC MUSHROOM- TREAT MUSHROOM CHOCOLATE BAR ALBINO ENVY (APE) TOP QUALITY PREMIUM MUSHROOM FOR SALE CANADA - 1 Update
- WHERE TO BUY ALBINO PENIS ENVY-PSILOCYBIN MAGIC MUSHROOM- TREAT MUSHROOM CHOCOLATE BAR ALBINO ENVY (APE) TOP QUALITY PREMIUM MUSHROOM FOR SALE IN AUSTRALIA. - 1 Update
- N1 ALBINO PENIS ENVY-PSILOCYBIN MAGIC MUSHROOM- TREAT MUSHROOM CHOCOLATE BAR ALBINO ENVY (APE) TOP QUALITY PREMIUM MUSHROOM FOR SALE IN USA - 1 Update
- BES ALBINO PENIS ENVY-PSILOCYBIN MAGIC MUSHROOM- TREAT MUSHROOM CHOCOLATE BAR ALBINO ENVY (APE) TOP QUALITY PREMIUM MUSHROOM 1G,2G,3G,4G,5G,6G AND 1POUNDS FOR SALE - 1 Update
- Credit clone card - 1 Update
- Thread-safe initialization of static objects - 2 Updates
- BUY GOLDEN TEACHER MUSHROOM/GOLDEN TEACHER DRIED MUSHROOMS/ BUY GOLDEN TEACHER MAGIC MUSHROOM 2g,3g,7g,14g/BUY PSILOCYBIN MAGIC - 1 Update
| Anton Shepelev <anton.txt@gmail.moc>: Oct 08 03:22PM +0300 Hello, all While comp.lang.c is being choked by spammers, let me ask it in .c++ as well. Is it possible with the C preprocessor to generate code patterns of the following form: if( <expr_1> ) { ret = 1; goto PREPROC; RET_1: <stmt_1>; return; } if( <expr_2> ) { ret = 2; goto PREPROC; RET_2: <stmt_2>; return; } ... // many lines of intermediate code switch( ret ) { case 1: goto RET_1; break; case 2: goto RET_2; break; ... } where the programmer (more or less) only specifies the test expressions and corresponding statements, e.g.: #TEST( <expr_1> ) <stmt_1>; // may bec compund, many lines #TEST( <expr_2> ) <stmt_2>; #INTERMEDIATE #TEST_END -- () ascii ribbon campaign -- against html e-mail /\ www.asciiribbon.org -- against proprietary attachments |
| Anton Shepelev <anton.txt@gmail.moc>: Oct 08 03:47PM +0300 I wrote: > case 2: goto RET_2; break; > ... > } In the code above, label PREPROC is missing. It should be placed before the `switch' statement. -- () ascii ribbon campaign -- against html e-mail /\ www.asciiribbon.org -- against proprietary attachments |
| Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Oct 08 02:34PM -0400 Anton Shepelev wrote: >> } > In the code above, label PREPROC is missing. It should be > placed before the `switch' statement. Straightforward following your description would give something like: #define STRANGE_IF(n, e, s) if (e) { ret = n; goto PREPROC; RET_##n: s; } STRANGE_IF(1, a==b, b=c) STRANGE_IF(2, c==b, c=d) .. #undef STUPID_IF ... PREPROC: switch(ret) { #define STRANGE_CASE(n) case n: goto RET_##n; break; STRANGE_CASE(1) STRANGE_CASE(2) ..
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment