h3rb / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

namespace macro could be simplified #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There's an easier way to add the namespace logic to all files. Currently we 
need to add 3 or 4 
lines at the start and end of every file which makes for a lot of 
cut-and-pasting.

Instead we could define a pair of macros:

#define OSL_NAMESPACE_BEGIN namespace OSL_NAMESPACE {
#define OSL_NAMESPACE_END   } using namespace OSL_NAMESPACE;
When OSL_NAMESPACE is not being used, these macros would be defined to be empty.

Instead of adding 7 lines per file, this adds only 3 (1 include for the 
definition and the 
begin/end). Could be reduced to just 2 lines/file if we put this logic in a 
header everyone already 
includes.

It also centralizes the handling of this subtle feature.

1/16/09 11:20:14 changed by lg 

 I'm ok with this change. Maybe the macros should be in oslconfig.h? Or their own file?

11/16/09 11:21:42 changed by ckulla 

oslconfig.h sounds fine to me.

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 6:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by rene.lim...@gmail.com on 13 Jan 2010 at 1:31