ode/precision.h

32 views
Skip to first unread message

Oleh Derevenko

unread,
Jul 17, 2012, 5:17:29 PM7/17/12
to ODE Group
Gentlemen,
 
Regarding that include/ode/precision.h[.in] you added recently.
It's good for UNIX-like environment but in Visual Studio dSINGLE or dDOUBLE is chosen from a dropbox by selecting solution configuration and is applied by compiler automatically. So having another define explicitly in a file is somewhat unnatural (let it aside that the file is not handled in any way by premake.exe while building project and by default the solution just does not compile because precision.h is missing). Would not you consider reverting back to configuration without "precision.h" file since it is not applicable in MSVC environment?

Oleh Derevenko
-- Skype with underscore
 

Daniel K. O.

unread,
Jul 17, 2012, 7:31:39 PM7/17/12
to ode-...@googlegroups.com
No.


--
Daniel K. O.

Oleh Derevenko

unread,
Jul 18, 2012, 6:11:57 AM7/18/12
to ode-...@googlegroups.com
This is what I mean.
 
How do you imagine that header with dSINGLE or dDOUBLE included in project if ALL configurations are available at the same time for switching in IDE?
 
Oleh Derevenko
-- Skype with underscore
--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to
ode-...@googlegroups.com.
To unsubscribe from this group, send email to
ode-users+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/ode-users?hl=en.


Selection.png

Mikko Rasa

unread,
Jul 18, 2012, 6:26:28 AM7/18/12
to ode-...@googlegroups.com
Can't you somehow keep the precision.h file for *nix environments but
disable it for MSVC? Relying on compiler command-line options is rather
error-prone, even more so for a setting where an incorrect value will
crash the library.

Mikko

On 18.07.2012 13:11, Oleh Derevenko wrote:
> This is what I mean.
>
>

Dimitris Papavasiliou

unread,
Jul 18, 2012, 10:10:51 AM7/18/12
to ode-...@googlegroups.com
I suppose using some guard like this one would do the trick.

#ifndef _MSC_VER
#include "ode/precision.h"
#endif

Of course it would probably be wiser to put it inside precision.h:

#ifndef _MSC_VER
#define dDOUBLE
#endif

Dimitris

Erwin Coumans

unread,
Jul 18, 2012, 11:55:14 AM7/18/12
to ode-...@googlegroups.com
how about XCode? Just like MSVC it lets you choose configurations using a GUI.
--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ode-users/-/wQ09xxKXl_IJ.

jcooper

unread,
Jul 18, 2012, 2:46:51 PM7/18/12
to ode-...@googlegroups.com
I like this method.  One might also simply bracket with something like this if it works for the various supported compilers:

#if !defined(dDOUBLE) && !defined(dSINGLE)
#define dDOUBLE
#endif

jc

Patrick

unread,
Jul 18, 2012, 3:29:36 PM7/18/12
to ode-...@googlegroups.com
It's really just one line of code:

#define dDOUBLE

Or 

#define dSINGLE

I'm not sure why this is difficult. 

Patrick


--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ode-users/-/l9mmrEo0dPoJ.
Reply all
Reply to author
Forward
0 new messages