loguru
loguru copied to clipboard
VS2017 - error C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup.
Here is what my loguru implementation file looks like. My project uses warning level 4.
#include "stdafx.h"
#pragma warning( push )
#pragma warning( disable : 4100) //unreferenced parameters
#pragma warning( disable : 4996) //security warnings, strcpy and such
//silences warnings about "nonstandard" function
#define strdup _strdup
#define LOGURU_IMPLEMENTATION 1
#include "../loguru/loguru.hpp"
#undef strdup
#pragma warning( pop )
It might be a workaround, but it would be better if it could be solved in the library.
This should be easy to add to Loguru, but without access to VS2017 I don't think I should be the one making the PR. Any takers?