Friday, January 2, 2009

comp.lang.c++ - 15 new messages in 6 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* Weird Function Declaration - 4 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/1976c4d0730bf7fd?hl=en
* Custom STL in place allocator crashed - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/0a248a2e913ba6c1?hl=en
* MFC Golmine site updated http://mfcgoldmine.by.ru/index.html - 7 messages, 4
authors
http://groups.google.com/group/comp.lang.c++/t/cd8333fd25b20df2?hl=en
* C++ vs. C# - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/a7db16921180bbce?hl=en
* Database Connectivity with C++ - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/3f92a4b05699f508?hl=en
* information - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/32f18cc5a4d7697c?hl=en

==============================================================================
TOPIC: Weird Function Declaration
http://groups.google.com/group/comp.lang.c++/t/1976c4d0730bf7fd?hl=en
==============================================================================

== 1 of 4 ==
Date: Thurs, Jan 1 2009 4:22 pm
From: Jeff Schwab


Puppet_Sock wrote:
> On Jan 1, 10:32 am, Steve Chow <msweaksa...@hotmail.com> wrote:
> [snip]
>> But it appears you're correct only 99% of the time. :-) Apparently
>> CALLBACK does actually mean something in Windows, it's a nice way of
>> saying __stdcall, which is apparently some proprietary calling
>> convention hackery which is necessary sometimes.
>
> Not in Windows, but in some library code provided with
> some compilers. Your example is not relevant to that
> though, since in your example you have CALLBACK defined
> to be nothing.

CALLBACK is only defined to be nothing if it was not previously defined,
e.g. by an included file or compiler flag. Defining it could also
control the behavior of subsequently included files.

> Windows as such does not know from the definition of
> CALLBACK in source code. It's an OS. (Sort of.)

I think Juha called it: Some code processor, orthogonal to the
traditional too chain, may look for CALLBACKs. A very similar mechanism
is used with Apple's Interface Builder in the form of the IBOutlet
macro. In fact, Objective-C actions (a flavor of callbacks) are
generally marked with the IBAction macro, whose definition is the moral
equivalent of "#define IBAction void".


== 2 of 4 ==
Date: Thurs, Jan 1 2009 5:07 pm
From: "jason.cipriani@gmail.com"


On Jan 1, 10:32 am, Steve Chow <msweaksa...@hotmail.com> wrote:
> On Jan 1, 7:06 am, Juha Nieminen <nos...@thanks.invalid> wrote:
>
>
>
> > Steve Chow wrote:
> > > I recently saw this in some C++/OpenGL (it is apparently required)
> > > code (and this is a C++ question, not OpenGL). And the relevant part
> > > went something like this:
>
> > > #ifndef CALLBACK
> > > #define CALLBACK
> > >

No comments:

Post a Comment