* class Q_CORE_EXPORT QFlag
@ 2007-05-01 11:54 Shriramana Sharma
2007-05-04 11:27 ` leslie.polzer
2007-05-04 12:04 ` Steve Graegert
0 siblings, 2 replies; 6+ messages in thread
From: Shriramana Sharma @ 2007-05-01 11:54 UTC (permalink / raw)
To: Linux C Programming List
I see many usages in the Qt sources like:
class Q_CORE_EXPORT QFlag
{
<blah blah blah>
} ;
Isn't the word immediately next to the keyword class supposed to be the
class name? Q_CORE_EXPORT etc are certainly not class names. What are
they and how are they allowed in between the word class and the class name?
I searched my "Thinking in C++" for this but did not turn up an answer.
Please help.
Thanks as always,
Shriramana Sharma.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: class Q_CORE_EXPORT QFlag
2007-05-01 11:54 class Q_CORE_EXPORT QFlag Shriramana Sharma
@ 2007-05-04 11:27 ` leslie.polzer
2007-05-04 12:04 ` Steve Graegert
1 sibling, 0 replies; 6+ messages in thread
From: leslie.polzer @ 2007-05-04 11:27 UTC (permalink / raw)
To: Shriramana Sharma; +Cc: Linux C Programming List
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
On Tue, May 01, 2007 at 05:24:54PM +0530, Shriramana Sharma wrote:
> I see many usages in the Qt sources like:
>
> class Q_CORE_EXPORT QFlag { <blah blah blah> } ;
>
> Isn't the word immediately next to the keyword class supposed to be
> the class name? Q_CORE_EXPORT etc are certainly not class names. What
> are they and how are they allowed in between the word class and the
> class name?
It's either a C preprocessor symbol defined somewhere else, or, what's
more likely, a MOC preprocessor symbol.
Leslie
--
Personal homepage: https://viridian.dnsalias.net/~sky/homepage/
gpg --keyserver pgp.mit.edu --recv-keys DD4EBF83
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: class Q_CORE_EXPORT QFlag
2007-05-01 11:54 class Q_CORE_EXPORT QFlag Shriramana Sharma
2007-05-04 11:27 ` leslie.polzer
@ 2007-05-04 12:04 ` Steve Graegert
2007-05-14 18:50 ` Shriramana Sharma
1 sibling, 1 reply; 6+ messages in thread
From: Steve Graegert @ 2007-05-04 12:04 UTC (permalink / raw)
To: Shriramana Sharma; +Cc: Linux C Programming List
On 5/1/07, Shriramana Sharma <samjnaa@gmail.com> wrote:
> I see many usages in the Qt sources like:
>
> class Q_CORE_EXPORT QFlag
> {
> <blah blah blah>
> } ;
>
> Isn't the word immediately next to the keyword class supposed to be the
> class name? Q_CORE_EXPORT etc are certainly not class names. What are
> they and how are they allowed in between the word class and the class name?
>
> I searched my "Thinking in C++" for this but did not turn up an answer.
> Please help.
It's a macro that expands with different results depending on the
platform and/or context. For example when building Qt applications on
a Windows machine, it's redefined to Q_DECL_EXPORT which, in this
case, expands to __declspec(dllexport). See
/src/corelib/global/qglobal.h in the Qt source tree.
\Steve
--
Steve Grägert <steve@graegert.com>
Jabber xmpp://graegerts@jabber.org
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: class Q_CORE_EXPORT QFlag
2007-05-04 12:04 ` Steve Graegert
@ 2007-05-14 18:50 ` Shriramana Sharma
2007-05-15 10:12 ` Shriramana Sharma
2007-05-15 16:54 ` Glynn Clements
0 siblings, 2 replies; 6+ messages in thread
From: Shriramana Sharma @ 2007-05-14 18:50 UTC (permalink / raw)
To: Steve Graegert; +Cc: Linux C Programming List
Thanks Leslie and Steve. It did not occur to me that it would be
something MOC takes care of.
I need to read up on what these mangled __ symbols mean. I have seen
some in glibc sources (just perused a few files) especially things like
__throw -- probably flags to the C++ compiler indicating what a
particular class or function or whatever behaves like, yes?
Shriramana Sharma.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: class Q_CORE_EXPORT QFlag
2007-05-14 18:50 ` Shriramana Sharma
@ 2007-05-15 10:12 ` Shriramana Sharma
2007-05-15 16:54 ` Glynn Clements
1 sibling, 0 replies; 6+ messages in thread
From: Shriramana Sharma @ 2007-05-15 10:12 UTC (permalink / raw)
To: Linux C Programming List
Shriramana Sharma wrote:
> I need to read up on what these mangled __ symbols mean.
Um I am at a loss to where to start... Can anyone point me to good
reading on this topic? Thanks.
Shriramana Sharma.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: class Q_CORE_EXPORT QFlag
2007-05-14 18:50 ` Shriramana Sharma
2007-05-15 10:12 ` Shriramana Sharma
@ 2007-05-15 16:54 ` Glynn Clements
1 sibling, 0 replies; 6+ messages in thread
From: Glynn Clements @ 2007-05-15 16:54 UTC (permalink / raw)
To: Shriramana Sharma; +Cc: Steve Graegert, Linux C Programming List
Shriramana Sharma wrote:
> Thanks Leslie and Steve. It did not occur to me that it would be
> something MOC takes care of.
>
> I need to read up on what these mangled __ symbols mean. I have seen
> some in glibc sources (just perused a few files) especially things like
> __throw -- probably flags to the C++ compiler indicating what a
> particular class or function or whatever behaves like, yes?
Identifiers beginning with an underscore are reserved for the
"implementation", i.e. the compiler and/or standard libraries (libc
and libm). Specifically:
-- All identifiers that begin with an underscore and
either an uppercase letter or another underscore are
always reserved for any use.
-- All identifiers that begin with an underscore are
always reserved for use as identifiers with file scope
in both the ordinary and tag name spaces.
Most of them will be documented in the Info files for gcc and glibc.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-05-15 16:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-01 11:54 class Q_CORE_EXPORT QFlag Shriramana Sharma
2007-05-04 11:27 ` leslie.polzer
2007-05-04 12:04 ` Steve Graegert
2007-05-14 18:50 ` Shriramana Sharma
2007-05-15 10:12 ` Shriramana Sharma
2007-05-15 16:54 ` Glynn Clements
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).