switch to c++14 and make use of generalized lambda capture
parent
9ffcec83c8
commit
bfe9d5aff2
2
Makefile
2
Makefile
|
@ -5,7 +5,7 @@ OCTASTD_PATH = ../octastd
|
|||
|
||||
FILES = main.o globs.o cubescript.o
|
||||
|
||||
OB_CXXFLAGS += -std=c++11 -I. -I$(CUBESCRIPT_PATH) -I$(OCTASTD_PATH) -pthread
|
||||
OB_CXXFLAGS += -std=c++14 -I. -I$(CUBESCRIPT_PATH) -I$(OCTASTD_PATH) -pthread
|
||||
|
||||
all: obuild
|
||||
|
||||
|
|
4
main.cc
4
main.cc
|
@ -573,9 +573,7 @@ int main(int argc, char **argv) {
|
|||
os.add_command("shell", "C", [](ObState &os, ConstCharRange s) {
|
||||
auto cnt = os.counters.back();
|
||||
cnt->incr();
|
||||
String ds = s;
|
||||
/* in c++14 we can use generalized lambda captures to move the str */
|
||||
tpool.push([cnt, ds]() {
|
||||
tpool.push([cnt, ds = String(s)]() {
|
||||
int ret = system(ds.data());
|
||||
if (ret && !cnt->result)
|
||||
cnt->result = ret;
|
||||
|
|
|
@ -7,7 +7,7 @@ OS_PATH = "../octastd"
|
|||
|
||||
FILES = [main_ob.o globs_ob.o cubescript_ob.o]
|
||||
|
||||
OB_CXXFLAGS = [@OB_CXXFLAGS -std=c++11 -I. -I@CS_PATH -I@OS_PATH -pthread]
|
||||
OB_CXXFLAGS = [@OB_CXXFLAGS -std=c++14 -I. -I@CS_PATH -I@OS_PATH -pthread]
|
||||
|
||||
rule obuild $FILES [
|
||||
echo " LD" $target
|
||||
|
|
Loading…
Reference in New Issue