tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Newcomer to TCC (and C) with a couple ofquestions..


From: Kalle Olavi Niemitalo
Subject: Re: [Tinycc-devel] Newcomer to TCC (and C) with a couple ofquestions..
Date: Fri, 03 Apr 2009 11:05:13 +0300
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)

lostgallifreyan <address@hidden> writes:

> You cite from MSDN... I take it this is because TCC defaults to
> using MSVCRT? (Or, I read tonight, Kernel32.dll if the program
> entry point was written to avoid using MSVCRT).

The Windows GDI functions are in USER32 and GDI32, not MSVCRT.
I cite from MSDN because Microsoft has designed the GDI functions
(the first ones perhaps in cooperation with IBM, for OS/2?) and
maintains them as part of Windows and gets to decide how they
work.

> So I guess that this is entirely Windows native C for the Win32
> TCC compiler. Still confuses me a tad though, ANSI C being
> portable. I'm not sure where the general and the specific meet
> there..

The C language is portable but the GDI functions that programs
can call are specific to Windows.  The C standard does not
specify any way for programs to display graphics or colours.
Different vendors provide different ways of doing that and some
of these ways have been standardized but not as part of C.

> And that means I'm not sure how I should write any GDI
> oriented code if I want it to compile on Linux. I'd thought the
> same might apply to both.

Ah, you mentioned GDI resources in your original post, so I
assumed you were intending the program to run on Windows only.
If it needs to run on Linux too, then you could perhaps use
Winelib <http://www.winehq.org/site/winelib>, which I believe
implements the Windows GDI functions on Linux.  Alternatively,
use some cross-platform graphics API such as GDK
<http://library.gnome.org/devel/gdk/> or SDL
<http://www.libsdl.org/> or even OpenGL; at least these three
should be usable from C without C++, and thus presumably with
TCC.  However, if you are already familiar with GDI and have a
lot of code that uses it, then switching to a different API may
require too much work.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]