Re: Euphoria++?
- Posted by Mike The Spike <mtsreborn at yahoo.com> Feb 01, 2001
- 432 views
LEVIATHAN, most excellent duder writes correctly: > > Can I request that the translator simply spit out > freaking > > ANSI C code instead of compiler-specific code? Robert Craig, most excellent coder and hard-head writes falsely: > There's a popular misconception floating around this > list > that you can write any program in pure ANSI C, and > you'll be able to compile it using any compiler on > any > platform and your program will run without change > and do anything you want it to do. Sort of like the > Java concept. Misconception? And you have a master's degree in CS? > Show me in your ANSI C manual where it defines > how to put a pixel on the screen, how to perform > a DOS interrupt, how to set the color of a piece of > text, > etc. etc. etc. It doesn't say that in an ANSI C manual, however it does say that you must place platform specific code in an #ifdef capsule. Is it so hard to understand that if you do this; #ifdef WIN32 puts("YEAH!! You compiled with a Win32 compiler!"); #else #ifdef DOS32 puts("BOOH!! You compiled with a DOS compiler!"); #endif #else puts("Wha? You compiled a fplatform other that DOS and Windows! So I'm using ANSI code only! Yipee"); #endif You code will compile on any platform? Sure, if the compiler used was not for DOS, Windows or Linux, you can place some ANSI C printf's that say "Sorry! No graphics for this unknown platform! write your own code!". But atleast you support EVERY ANSI C compiler for Dos, WIndows and Linux, and not just a few of them (Take Vector C, extremely fast new compiler, it's extremely fast with floats and memory handling, I can never use it with Euphoria. Or VC++? Or Symantec C? Or MingW? Cygnus? Or a C interpreter? Etc...) Take a good look at how Pete's Portable Euphoria does it: #ifdef ALLEGRO #include <allegro.h> #endif His code compiles with LCC Win32! While it was written for DJGPP!!!! It's ANSI C code and does everything Euphoria does (except for a few functions). Compile his code with DJGPP and you aotumatically can use Allegro graphics! Compile with LCC and you can't! Simple as that! But atleast it compiles!!! And you can add your own graphics library for the platform you want. If it says: #ifndef WIN32 #ifndef DOS32 /* Not Dos and not Windows */ #include <drawing.h> /* Gameboy */ #include <cgb.h> int pixel(int, int) { LCD_OFF; /* Write the pixel on the gameboy */ LCD_ON; } #endif #endif Easy huh? Just do it, it'll make us all feel better. Include allegro for DOS if DJGPP has being recognised, otherwise use your own SVGA routines. Euphoria don't allow graphics in Win32 anyways, so what the big deal? Mike The Spike > Regards, > Rob Craig > Rapid Deployment Software > http://www.RapidEuphoria.com > >