473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

extra feature on function syntax, what is it for?

I'm a beginning c++ user, pretty handy at java already but I want to
transfer to c++. Particullary because c++ is way better in processing
graphical processes and mathematical calculations fast. So I was
looking at some code of a graphic tool and stumbled on this:

COREDLL void pbrtCleanup() {
StatsCleanup();
// API Cleanup
if (currentApiState == STATE_UNINITIALIZED)
Error("pbrtCleanup() called without pbrtInit().");
else if (currentApiState == STATE_WORLD_BLOCK)
Error("pbrtCleanup() called while inside world block.");
currentApiState = STATE_UNINITIALIZED;
delete renderOptions;
renderOptions = NULL;
}

Which is a function and I always thought it was <output type>
fct_name(<input types) by syntax. But now there is an extra feature in
front of the output type, the COREDLL thing in this case. Can someone
explain this to me?

Also on top of the page there is something defined like:
COREDLL ParamSet NullParams;

I'm not sure if I saw it before a class definition too or not but if
so I would like to know about it too :).

Thanks alot already

ps: you can see the code where I got this from at http://prideout.net/pbrt/api.cpp
Jan 16 '08 #1
3 1411
On Wed, 16 Jan 2008 14:33:03 -0800 (PST), "mi**************@gmail.com"
<mi**************@gmail.comwrote in comp.lang.c++:
I'm a beginning c++ user, pretty handy at java already but I want to
transfer to c++. Particullary because c++ is way better in processing
graphical processes and mathematical calculations fast. So I was
looking at some code of a graphic tool and stumbled on this:

COREDLL void pbrtCleanup() {
StatsCleanup();
// API Cleanup
if (currentApiState == STATE_UNINITIALIZED)
Error("pbrtCleanup() called without pbrtInit().");
else if (currentApiState == STATE_WORLD_BLOCK)
Error("pbrtCleanup() called while inside world block.");
currentApiState = STATE_UNINITIALIZED;
delete renderOptions;
renderOptions = NULL;
}

Which is a function and I always thought it was <output type>
fct_name(<input types) by syntax. But now there is an extra feature in
front of the output type, the COREDLL thing in this case. Can someone
explain this to me?
Well, not in detail, because it is not something defined by C++.

"COREDLL" is either one of two things:

1. Some sort of non-standard, compiler/platform specific macro that
tells the compiler to do something out of the ordinary, such as use a
particular calling or parameter passing interface.

2. Even more likely, a macro that expands to something equivalent to
number 1.

A quick Google for "COREDLL" turns up links that seem to indicate that
is an extension used particularly for Windows CE, and not.

For more information:

http://www.google.com/search?hl=en&q...=Google+Search
Also on top of the page there is something defined like:
COREDLL ParamSet NullParams;

I'm not sure if I saw it before a class definition too or not but if
so I would like to know about it too :).

Thanks alot already
If you don't program for Windows CE, or even better, never heard of
Windows CE, you cannot use this code, at least as it is written.

If you do program for Windows CE, and want more information, try
Microsoft's MSDN web site or Windows CE specific newsgroups. It is a
Windows thing, not a C++ one.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Jan 16 '08 #2
mi**************@gmail.com:
COREDLL void pbrtCleanup()

You'll probably find that COREDLL is a #define for something like
"__stdcall". So what you have would be:

__stdcall void pbrtCleanup()

The C++ Standard doesn't have any mention of anything like "__stdcall", but
on your own particular platform it might mean something like "this function
is to be provided as an exported function in the DLL file".

--
Tomás Ó hÉilidhe
Jan 17 '08 #3
yeah you are right, I got this information too :). thanks!

COREDLL is a macro defined in pbrt.h. The reason is that on windows
systems you need __declspec() commands to import/export class
definitions to/from dll's (I forget which). For unix systems the
COREDLL token will be removed by the preprocessor.

#ifdef WIN32

#ifdef CORE_SOURCE
#define COREDLL __declspec(dllexport)
#else
#define COREDLL __declspec(dllimport)
#endif
#define DLLEXPORT __declspec(dllexport)

#else

#define COREDLL
#define DLLEXPORT

#endif
Jan 17 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jordan Rastrick | last post by:
First, a disclaimer. I am a second year Maths and Computer Science undergraduate, and this is my first time ever on Usenet (I guess I'm part of the http generation). On top of that, I have been...
1
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. In fact there...
5
by: Sriram Rajagopalan | last post by:
Hi, Is the extra comma at the end of an enumerator-list valid according to the C standards? With the gcc compiler the following is valid: enum DAYS {MONDAY, TUESDAY, }day1; gcc does not...
4
by: christopher diggins | last post by:
A feature that I find signficantly missing in C# is the ability to write functions in interfaces that can call other functions of the interface. Given an interface ISomeInteface the only way we can...
18
by: Kamen Yotov | last post by:
hi all, i first posted this on http://msdn.microsoft.com/vcsharp/team/language/ask/default.aspx (ask a c# language designer) a couple of days ago, but no response so far... therefore, i am...
3
by: Tony Johansson | last post by:
Hello! We have MFC application from VC6. Assume we compile the MFC application in VC8. Does anything special be done to the MFC application accept remove all the errors before being able to use...
32
by: toolmaster | last post by:
Since many of the modern computer languages have built-in namespace features, I can't understand why not add this feature into standard C. I've heard many people complain of the lacking of...
11
by: Xah Lee | last post by:
Of interest: • The Semicolon Wars, by Brian Hayes. 2006. http://www.americanscientist.org/template/AssetDetail/assetid/51982 in conjunction to this article, i recommend: • Software...
1
by: MisterWilliam | last post by:
I noticed that in PEP 3105, the PEP about turning print to print(), the syntax for print() is defined as follows: def print(*args, sep=' ', end='\n', file=None) Ignoring the fact that print is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.