Skip to content

Does not compile with Visual C++ 2010 x64 #182

@exhu

Description

@exhu

vcc 64-bit does not support inline assembler so I get the following errors:

cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
astalgo.c
E:\Nimrod\lib\nimbase.h(223) : error C4235: nonstandard
 extension used : '_asm' keyword not supported on this architecture
E:\Nimrod\lib\nimbase.h(223) : error C4235: nonstandard
 extension used : '_asm' keyword not supported on this architecture
E:\Nimrod\lib\nimbase.h(224) : error C2065: 'fld' : undeclared ident
ifier
E:\Nimrod\lib\nimbase.h(224) : error C2065: 'fld' : und
eclared identifier
E:\Nimrod\lib\nimbase.h(224) : error C2146: syntax erro
r : missing ';' before identifier 'flt'

"Inline asm is not supported by Visual C++ on 64-bit machines. Therefore, if you want your code to be 64-bit compatible, you need to use intrinsics." http://msdn.microsoft.com/en-us/library/azcs88h2.aspx

Don't know what places of nimrod this affects, but I've put the following into 'nimbase.h' (line 215) and it compiled (_note _M_X64_)":

#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \
   && !defined(__BORLANDC__) && !defined(__POCC__) && !defined(_M_X64)

/*  Win32 doesn't seem to have these functions.
**  Therefore implement inline versions of these functions here.
*/
static N_INLINE(long int, lrint)(double flt) {
  long int intgr;
  _asm {
    fld flt
    fistp intgr
  };
  return intgr;
}

Now it builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions