Bug 2918 - Rename Rectangle class to silent Visual Studio errors
Rename Rectangle class to silent Visual Studio errors
Status: PATCH PENDING
Product: ns-3
Classification: Unclassified
Component: mobility models
ns-3.28
All Windows
: P3 normal
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-16 16:26 EDT by sebastien.deronne
Modified: 2018-05-17 14:28 EDT (History)
1 user (show)

See Also:


Attachments
Patch to rename Rectangle class to Rectangle2d (23.59 KB, patch)
2018-05-17 05:52 EDT, sebastien.deronne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sebastien.deronne 2018-05-16 16:26:54 EDT
Rectangle is the name of a GUI object in Windows.  All of the GUI objects in Windows are accessible from C programs so they don't exist in a namespace. To fix this, a clean solution would be to rename our Rectangle class.

I am now asking for a popular name. Please shout!

My proposal: 2dRectangle or Rectangle2d.
Comment 1 sebastien.deronne 2018-05-17 05:52:08 EDT
Created attachment 3096 [details]
Patch to rename Rectangle class to Rectangle2d

I made a patch based on my name proposal (Rectangle2d).
Comment 2 Tom Henderson 2018-05-17 09:23:17 EDT
(In reply to sebastien.deronne from comment #0)
> Rectangle is the name of a GUI object in Windows.  All of the GUI objects in
> Windows are accessible from C programs so they don't exist in a namespace.
> To fix this, a clean solution would be to rename our Rectangle class.
> 
> I am now asking for a popular name. Please shout!
> 
> My proposal: 2dRectangle or Rectangle2d.

Before we give up so easily on this, is it really the case that this name does not exist in a namespace?  According to this documentation, Rectangle is in a separate namespace.

https://msdn.microsoft.com/en-us/library/system.drawing

Is it possible that the configuration pulls in this namespace unnecessarily?  Is there a 'using System.Drawing;' somewhere?

If I am wrong about this, can someone point me to the full list of reserved names/keywords for Visual Studio?  These are the only lists I found:

https://msdn.microsoft.com/en-us/library/2e6a4at9.aspx
https://docs.microsoft.com/en-gb/cpp/build/reference/reserved-words
Comment 3 sebastien.deronne 2018-05-17 14:28:06 EDT
I cannot help on this, I assumed Robert already made different attempts to fix.