> This is a common need and trivial to code.
Hmm, is it though? I'm not sure... In practice, I've seldom found it
necessary to detect most (any?) of these things at runtime.
Though I guess cinepaint might well have needs that are rather more
complex that mine!
> Why not make it an FLTK class? Something like this...
I guess we'd accept contributions in this area.
You're the cinepaint guy, right?
So, I'm guessing your coding skills are probably better than mine...
Anyway, comments interleaved below...
> class Fl_OS
> {public:
> const char* Platform(); // Windows|Mac OS X|Linux|Other
Must be detected at compile time - I can't envisage how detecting this
at run time is useful. Am I missing something obvious?
> const int Bits(); // 32|64
OK - I concede you could detect this at runtime, but the current
compiler toolchains pretty much have to plump for one or the other model
at build time (linkage and libs and all that stuff), so again this is
essentially a compile time decision, not a runtime one.
Again, I may be missing something obvious.
> onnst char* Cpu(); // Intel|PPC
ARM? MIPS? Others? - Again, I don't see how this can usefully be
detected at runtime - if your code is running, it must already have been
compiled for the target, so must have known, at build time, what the
target CPU was.
> const int Cores(); // 1|2|4|8
Yup - I can see how that might be handy.
Though, as a caveat, I have to say that I write threaded code for
multi-cpu systems for my day job, and it turns out that, if you are
using one of the current crop of desktop-derived OS, it is often not all
that useful to know how many physical cores you actually have.
With some of our special purpose embedded OS targets, knowing the number
of cores *is* more useful, but again these special targets often know at
compile time how many cores they are targeting...
> const bool BigEndian(); // T|F
Again, determined at compile time, or surely your code will not run?
Standard caveat applies: there may well be some reason why these things
are useful to detect at runtime, it's just that the way I code does not
encounter these cases.
I'm happy to be enlightened, if there is something I'm missing here...
Cheers,
--
Ian
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk