Skip to content

MemoryBuffer::free() conflicts. #211

Closed
@FrankStain

Description

@FrankStain

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: ','

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