Fix building with musl libc
This commit is contained in:
parent
788c358720
commit
1ed66e9b6a
10
src/Makefile
10
src/Makefile
|
@ -1,4 +1,6 @@
|
|||
debug ?= yes
|
||||
pedantic ?= yes
|
||||
|
||||
ifeq ($(debug),yes)
|
||||
CPPFLAGS += -DKAK_DEBUG
|
||||
suffix := .debug
|
||||
|
@ -11,6 +13,10 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(pedantic),yes)
|
||||
CXXFLAGS += -pedantic
|
||||
endif
|
||||
|
||||
sources := $(wildcard *.cc)
|
||||
objects := $(addprefix ., $(sources:.cc=$(suffix).o))
|
||||
deps := $(addprefix ., $(sources:.cc=$(suffix).d))
|
||||
|
@ -22,8 +28,6 @@ bindir := $(DESTDIR)$(PREFIX)/bin
|
|||
sharedir := $(DESTDIR)$(PREFIX)/share/kak
|
||||
docdir := $(DESTDIR)$(PREFIX)/share/doc/kak
|
||||
|
||||
CXXFLAGS += -std=gnu++11 -g -Wall -Wno-reorder -Wno-sign-compare -pedantic
|
||||
|
||||
os := $(shell uname)
|
||||
|
||||
ifeq ($(os),Darwin)
|
||||
|
@ -46,6 +50,8 @@ else
|
|||
LDFLAGS += -rdynamic
|
||||
endif
|
||||
|
||||
CXXFLAGS += -std=gnu++11 -g -Wall -Wno-reorder -Wno-sign-compare
|
||||
|
||||
kak : $(objects)
|
||||
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(objects) $(LIBS) -o $@
|
||||
|
||||
|
|
|
@ -2,21 +2,24 @@
|
|||
|
||||
#include "string.hh"
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#if defined(__GLIBC__) || defined(__APPLE__)
|
||||
# include <execinfo.h>
|
||||
# include <stdlib.h>
|
||||
#elif defined(__CYGWIN__)
|
||||
# include <windows.h>
|
||||
# include <dbghelp.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
namespace Kakoune
|
||||
{
|
||||
|
||||
Backtrace::Backtrace()
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#if defined(__GLIBC__) || defined(__APPLE__)
|
||||
num_frames = backtrace(stackframes, max_frames);
|
||||
#elif defined(__CYGWIN__)
|
||||
num_frames = CaptureStackBackTrace(0, max_frames, stackframes, nullptr);
|
||||
|
@ -25,7 +28,7 @@ Backtrace::Backtrace()
|
|||
|
||||
String Backtrace::desc() const
|
||||
{
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#if defined(__GLIBC__) || defined(__APPLE__)
|
||||
char** symbols = backtrace_symbols(stackframes, num_frames);
|
||||
ByteCount size = 0;
|
||||
for (int i = 0; i < num_frames; ++i)
|
||||
|
|
Loading…
Reference in New Issue
Block a user