Giter VIP home page Giter VIP logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
strerror_s() may be defined since vs2005

Original comment by fifywang on 8 Dec 2009 at 2:47

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Searching for localtime_s finds 
http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx which seems to 
indicate that this function is declared under Windows, in file time.h.

Looking at the file windows/port.h, we see the following block of code right at 
the top:


#ifdef _WIN32

#define WIN32_LEAN_AND_MEAN  /* We always want minimal includes */
#include <windows.h>
#include <winsock.h>         /* for gethostname */
#include <io.h>              /* because we so often use open/close/etc */
#include <direct.h>          /* for _getcwd() */
#include <process.h>         /* for _getpid() */
#include <stdio.h>           /* read in vsnprintf decl. before redifining it */
#include <stdarg.h>          /* template_dictionary.cc uses va_copy */
#include <string.h>          /* for _strnicmp(), strerror_s() */
#include <time.h>            /* for localtime_s() */
/* Note: the C++ #includes are all together at the bottom.  This file is
 * used by both C and C++ code, so we put all the C++ together.
 */

This seems to indicate that the variable _WIN32 is not defined.  But this 
article 
http://stackoverflow.com/questions/662084/whats-the-difference-between-the-win32
-and-win32-defines-in-c seems to indicate that _WIN32 should automatically be 
defined by your compiler...



Original comment by [email protected] on 12 Oct 2010 at 3:50

from google-glog.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Hi, 

- @tom.ritchford .. VS.NET 2003 does not contain the localtime_s etc methods, 
the link you provided is for VS.NET 2005. still its very easy to replace those 
methods with the none-safe versions.. 
see
http://msdn.microsoft.com/en-us/library/bf12f0hc%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/zc53h9bh%28v=vs.71%29.aspx

- This won't solve the varargs problem.. A way to get around this can be found 
at 
http://rclermont.blogspot.com/2008/05/macros-and-variable-arguments-in.html

But that would just be hacks just to let VS.NET 2003 compile..


Original comment by [email protected] on 25 Sep 2011 at 3:49

from google-glog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.