-1

I have C++ code in a project which behaves differently with Visual Studio 2010 and VS 2015.

    if(return_val != 0)
    {
      ACE_OS::set_errno_to_last_error ();
      result->set_error(errno);
    }

return_val is the the return value of a prior function which has failed. So the next step is to capture error value.

In VS 2010

When result->set_error(errno) is called, while debugging, the control goes to the function _errno() , defined in source \VC\crt\src\dosmap.c.

In VS 2015 The source dosmap.c is not found. The macro expansion for errno must be in a different place I suppose. But the behaviour should be same

Do I need to make any change in the VS settings for 2015? Any help would be useful.

Christian.K
  • 47,778
  • 10
  • 99
  • 143
G.S
  • 123
  • 3
  • 11
  • I don't quite understand your question. Is something not working? Why does it matter where `errno` is defined? – Cameron Dec 03 '15 at 17:30
  • The errno is set to value 2 in VS 2010. Where as in Vs 2015 it is set to 0. – G.S Dec 03 '15 at 17:49

1 Answers1

0

I think you have not installed the source files for the library. This would explain why it can't find the file.

errno is a strange variable, and is thread-local, and macro'ed in both platforms. What is happening in ACE_OS::set_errno_to_last_error ();?

If the function is not setting the errno value, that would explain the behavior differences.

mksteve
  • 12,614
  • 3
  • 28
  • 50
  • ACE_OS::set_errno_to_last_error (); does this errno = ::GetLastError (); Source files for which library? i did a default installation for 2015 – G.S Dec 03 '15 at 17:55