By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,411 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,411 IT Pros & Developers. It's quick & easy.

Querry Regarding Define

P: n/a
Hi All,

#define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
name={sizeof(L##s)/2-1,L##s}
#define _L(a) (TPtrC((const TText *)L ## a))

can any one explain me the above two, I am geting bit confused.

Thanks In Advance.
Priya

Dec 14 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Priya Mishra" <mi*******@gmail.com> writes:
#define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
name={sizeof(L##s)/2-1,L##s}
#define _L(a) (TPtrC((const TText *)L ## a))


This looks like C++, not C.

DES
--
Dag-Erling Smørgrav - de*@des.no
Dec 14 '05 #2

P: n/a
On Wed, 14 Dec 2005 03:55:01 -0800, Priya Mishra wrote:
Hi All,

#define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
name={sizeof(L##s)/2-1,L##s}
It's generally a good idea to keep your lines shorter than 80 characters.
Especially when posting to usenet. This would be a syntax error, but I'll
imagine there's a backslash at the end of the first line.

Also, _LIT16 is also a bad thing to call virtually anything, since you'd
be invading implementation namespace. The same goes for _L.
#define _L(a) (TPtrC((const TText *)L ## a))
I couldn't tell you what they're for, but:

_LIT16 (poop, string)
Should expand to the following:
static const TLitC16<sizeof(Lstring)/2> \
poop={sizeof(Lstring)/2-1,Lstring}

Which looks like a C++ template function of some sort. See comp.lang.c++
for more information about this.

_L (voov);
Should expand to:
(TPtrC((const TText *)Lvoov));

Which looks like a screaming mad sort of wrapper thing. Or a macro to
build screaming mad sort of wrapper things. Or possibly an uran-utan.

Google tells me both macros are part of the Symbian Developer Library,
which is indeed a C++ API, and that both macros were in fact /NOT/
written by someone called Bergholt Stuttley Johnson.

http://www.symbian.com/developer/tec...it16Macro.html
http://www.symbian.com/developer/tec...LMacro.html#_L
can any one explain me the above two, I am geting bit confused.


No wonder.

--
Pieter Droogendijk <pieter at binky dot org dot uk>
PGP/1E92DBBC [ Make way for the Emperor's Finest. ] binky.org.uk

Dec 14 '05 #3

P: n/a
On Wed, 14 Dec 2005 03:55:01 -0800, Priya Mishra wrote:
Hi All,

#define _LIT16(name,s) static const TLitC16<sizeof(L##s)/2>
name={sizeof(L##s)/2-1,L##s}
This appears to be intended for a C++ program. It defines a
constant instance of the TLitC16 template passing the size of some
family of types or variables 'Lx' where x is an integer. Given the usage
of 'name', i suspect a backslash is ommitted.
#define _L(a) (TPtrC((const TText *)L ## a))
This seems to define 'L' referenced above. A nice piece of obfuscated
coding.
can any one explain me the above two, I am geting bit confused.
Obviously. This refers to a C++ program using templates. It isn't C.
Thanks In Advance.


My pleasure.
Dec 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.