Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
4f117516
M
miniob
项目概览
oceanbase
/
miniob
大约 1 年 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4f117516
编写于
8月 11, 2022
作者:
羽飞
提交者:
GitHub
8月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #45 from hnwyllmm/main
print prompt in client on platform without readline
上级
6f78e4cb
2500a791
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
6 deletion
+6
-6
deps/common/lang/defer.h
deps/common/lang/defer.h
+5
-6
src/obclient/client.cpp
src/obclient/client.cpp
+1
-0
未找到文件。
deps/common/lang/defer.h
浏览文件 @
4f117516
...
@@ -26,7 +26,9 @@ public:
...
@@ -26,7 +26,9 @@ public:
~
DeferHelper
()
~
DeferHelper
()
{
{
defer_
();
if
(
defer_
)
{
defer_
();
}
}
}
private:
private:
...
@@ -35,8 +37,5 @@ private:
...
@@ -35,8 +37,5 @@ private:
}
// namespace common
}
// namespace common
#define AA(B, C) B##C
#define DERFER_NAME(suffix) defer_helper_##suffix
#define BB(B, C) AA(B,C)
#define DEFER(callback) common::DeferHelper DERFER_NAME(__LINE__)(callback)
#define DEFER(callback) common::DeferHelper BB(defer_helper_, __LINE__)(callback)
#undef AA
#undef BB
src/obclient/client.cpp
浏览文件 @
4f117516
...
@@ -51,6 +51,7 @@ char *my_readline(const char *prompt)
...
@@ -51,6 +51,7 @@ char *my_readline(const char *prompt)
fprintf
(
stderr
,
"failed to alloc line buffer"
);
fprintf
(
stderr
,
"failed to alloc line buffer"
);
return
nullptr
;
return
nullptr
;
}
}
fprintf
(
stdout
,
prompt
);
char
*
s
=
fgets
(
buffer
,
MAX_MEM_BUFFER_SIZE
,
stdin
);
char
*
s
=
fgets
(
buffer
,
MAX_MEM_BUFFER_SIZE
,
stdin
);
if
(
nullptr
==
s
)
{
if
(
nullptr
==
s
)
{
fprintf
(
stderr
,
"failed to read message from console"
);
fprintf
(
stderr
,
"failed to read message from console"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录