Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryBuffer::free() conflicts. #211

Closed
FrankStain opened this issue Oct 18, 2015 · 1 comment
Closed

MemoryBuffer::free() conflicts. #211

FrankStain opened this issue Oct 18, 2015 · 1 comment

Comments

@FrankStain
Copy link

https://github.com/cppformat/cppformat/blob/master/format.h#L462

Using MS Visual Studio project with turned on memory leaks monitoring its unable to compile format.h cuz free() now becomes a macro _free_dbg( p, _NORMAL_BLOCK ).

Suggest to rename this method into free_buffer().

Reproducing steps:

1- Modify format.h like that:
Was:

#ifndef FMT_FORMAT_H_
#define FMT_FORMAT_H_

#include <stdint.h>

Now:

#ifndef FMT_FORMAT_H_
#define FMT_FORMAT_H_

#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>

#include <stdint.h>

2- Try to compile format.cc using MS Visual Studio 2013+ (2015 used).
It will be failed with next messages:

format.h(465): warning C4003: not enough actual parameters for macro 'free'
format.h(475): warning C4003: not enough actual parameters for macro 'free'
format.h(504): warning C4003: not enough actual parameters for macro 'free'
format.h(465): error C2059: syntax error: ','
@vitaut
Copy link
Contributor

vitaut commented Oct 18, 2015

Oh my, MSVC is a mess. Fixed in 77b3200, thanks!

@vitaut vitaut closed this as completed Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants