Remove unused function: cwd()
This commit is contained in:
@@ -12,8 +12,6 @@ typedef struct uv_fs_s uv_fs_t;
|
||||
|
||||
namespace uv {
|
||||
|
||||
std::string cwd();
|
||||
|
||||
class rwlock;
|
||||
class loop;
|
||||
class async;
|
||||
|
||||
@@ -48,25 +48,6 @@ void uv_key_set(uv_key_t* key, void* value) {
|
||||
|
||||
namespace uv {
|
||||
|
||||
std::string cwd() {
|
||||
#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
|
||||
char dir[512];
|
||||
uv_cwd(dir, 512);
|
||||
return dir;
|
||||
#else
|
||||
size_t max = 0;
|
||||
std::string dir;
|
||||
do {
|
||||
max += 256;
|
||||
dir.resize(max);
|
||||
uv_cwd(const_cast<char *>(dir.data()), &max);
|
||||
} while (max == dir.size());
|
||||
dir.resize(max - 1);
|
||||
return dir;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
lock::lock(mutex &mtx_) : mtx(&mtx_) {
|
||||
if (mtx) { mtx->lock(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user