Compare commits
No commits in common. "1318c4983f830693cc614921b68f35ff46646f4a" and "77973fc0266b454f44cdcc7782b1a3debdd6d7aa" have entirely different histories.
1318c4983f
...
77973fc026
21
Makefile
21
Makefile
@ -1,19 +1,12 @@
|
|||||||
.POSIX:
|
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic
|
CXXFLAGS = -g -std=c++14 -Wall -Wextra -pedantic -static-libstdc++
|
||||||
CPPFLAGS = `sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
|
|
||||||
-e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
|
|
||||||
|
|
||||||
sdn: sdn.cpp CMakeLists.txt
|
all: sdn
|
||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
%: %.cpp CMakeLists.txt
|
||||||
-lacl `pkg-config --libs --cflags ncursesw`
|
$(CXX) $(CXXFLAGS) $< -o $@ `pkg-config --libs --cflags ncursesw` -lacl \
|
||||||
static: sdn.cpp CMakeLists.txt
|
`sed -ne 's/^project (\([^ )]*\).*/-DPROJECT_NAME="\1"/p' \
|
||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o sdn \
|
-e 's/^set (version \([^ )]*\).*/-DPROJECT_VERSION="\1"/p' CMakeLists.txt`
|
||||||
-static-libstdc++ \
|
|
||||||
-Wl,--start-group,-Bstatic \
|
|
||||||
-lacl `pkg-config --static --libs --cflags ncursesw` \
|
|
||||||
-Wl,--end-group,-Bdynamic
|
|
||||||
clean:
|
clean:
|
||||||
rm -f sdn
|
rm -f sdn
|
||||||
|
|
||||||
.PHONY: static clean
|
.PHONY: all clean
|
||||||
|
7
sdn.cpp
7
sdn.cpp
@ -353,6 +353,13 @@ fun print (const ncstring &nc, int limit) -> int {
|
|||||||
return total_width;
|
return total_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun compute_width (const wstring &w) -> int {
|
||||||
|
int total = 0;
|
||||||
|
for (const auto &c : w)
|
||||||
|
total += wcwidth (c);
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
fun compute_width (const ncstring &nc) -> int {
|
fun compute_width (const ncstring &nc) -> int {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (const auto &c : nc)
|
for (const auto &c : nc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user