Login  Register

Re: HOWTO: Compiling LibreCAD with Visual Studio 2003 (and Qt 4.3.1 ...)

Posted by dxli on Dec 30, 2011; 2:19pm
URL: https://forum.librecad.org/HOWTO-Compiling-LibreCAD-with-Visual-Studio-2003-and-Qt-4-3-1-tp5108768p5110110.html

Hi Martin,

Please note that the pull request you sent is for an old "ellipse" branch instead of "master" branch of my repository, and it may explain why the pull request can not be applied cleanly.

try something like:

$ git checkout -f -b dli dli/master
(a local dli branch)
$ git merge master
(if it doesn't merge cleanly, need to fix it here)
$ git push -u origin dli:for-upstream
(this will push dli branch to a for-upstream branch in your github repository)

finally, send pull request to my master branch from your for-upstream branch

I tend to actively adapt to C++11. The reason: Qt5 will be C++11, and we have no intention to hold back everything for Windows compiler, as windows version of Qt-creator can be used for windows.

Thanks,

Dongxu

On Fri, Dec 30, 2011 at 8:49 AM, tin-pot [via LibreCAD] <[hidden email]> wrote:
Hi Dongxu,

thank you for the help on Git! I'll try it out soon.

dxli wrote
std::isnormal() is used to verify the number is not zero (of cause, not
NAN/INF). We use it to tell the difference between ellipse arc and whole
ellipses. For example, an ellipse arc has start/end angles, if both are set
to be exactly zero ( isnormal() = false), we treat the ellipse arc as an
whole ellipse. This is different from an whole range arc, because an arc
from 0 to 2 Pi will still have a start/end point, while a whole ellipse has
no start/end point.
I see. I just wondered if a simple comparison to zero wouldn't do the
job easier. Or, even easier - and safer - have a three-valued orientation
flag (CW arc, CCW arc, full turn); this would mirror the situation with
circular arcs/circles.

dxli wrote
I suppose std::isnormal() is C++ standard, we just have to figure out how
to use it in windows.
Well, kind of: AFAIK it was first specified in C99 (ISO 9899:1999) and then
adopted in <cmath> of C++11 (ISO 14882:2011). I don't know how
common C++11 is supported today - current MSVC versions up to 2010
obviously don't care.

However, floating point classification functions are easy to emulate on MSVC
(there has been a _fpclass() function for years), and that is what I have done.

I think we should try to avoid introducing gratuitous dependencies on such
"bleeding edge" language/library features, or provide workarounds. After all,
Win XP 32/MSVC 2003 is still a "Tier 1" platform for Qt 4.5, and MSVC 2005
for Qt 4.7, so why hinder platform portability without necessitation?

Thank you, and happy holidays!

Martin



If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/HOWTO-Compiling-LibreCAD-with-Visual-Studio-2003-and-Qt-4-3-1-tp5108768p5110049.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.