Skip to content

unistd.h not available on Windows #521

@sipsorcery

Description

@sipsorcery

When compiling with msvc on Windows unistd.h is not available in leveldb/c.cc.

Excluding the header and also adding a definition for ssize_t and undefining _snprintf in port_win.h allows compilation to succeed.

db/c.cc

#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include "leveldb/cache.h"

port/port_win.h

#ifdef _MSC_VER
//#define snprintf _snprintf
#define close _close
#define fread_unlocked _fread_nolock
#include <stdint.h>
#ifdef _WIN64
typedef int64_t ssize_t;
#else
typedef int32_t ssize_t;
#endif
#endif

#include <string>

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