]> git.tdb.fi Git - libs/core.git/commitdiff
Remove an obsolete Makefile
authorMikko Rasa <tdb@tdb.fi>
Tue, 24 Jun 2008 19:33:50 +0000 (19:33 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 24 Jun 2008 19:33:50 +0000 (19:33 +0000)
Translate windows error codes to text in SystemError

Makefile [deleted file]
source/core/except.cpp

diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 1e310c3..0000000
--- a/Makefile
+++ /dev/null
@@ -1,95 +0,0 @@
-NAME           = core
-
-WORKDIR                = $(PWD)/../..
-TMP            = $(WORKDIR)/tmp/linux
-TGT            = $(HOME)/local
-
-CXX            = g++
-CC             = gcc
-AR             = ar
-CP             = cp
-
-LIBFILE                = libmsp$(NAME)
-
-MAKEFLAGS      += -s --no-print-directory
-INCLUDE                = -Isource -I$(TMP)/include
-LIB            = -L$(TMP)
-DEBUG          = 
-CFLAGS         = $(DEBUG) $(INCLUDE) -pipe -Wall 
-CXXFLAGS       = $(CFLAGS)
-
-PIC            = -fPIC
-SHARED         = .so
-STATIC         = .a
-
-override CFLAGS                += `pkg-config --cflags sigc++-2.0`
-override LDFLAGS       += `pkg-config --libs sigc++-2.0`
-override CXXFLAGS      += `pkg-config --cflags sigc++-2.0`
-
-SRC            = source
-SUBDIRS                = core time
-OBJS           = $(foreach SUBDIR, $(SUBDIRS), $(addprefix $(TMP)/$(SUBDIR)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/$(SUBDIR)/*.cpp))))))
-
-pkgincludedir  = include/msp
-libdir         = lib
-
-foo = "echo $</$(SUBDIR); mkdir -p $</$(SUBDIR); $(CP) -r $(SRC)/$(SUBDIR)/*.h $</$(SUBDIR)"
-.PHONY: all
-all: $(TMP) $(TMP)/$(LIBFILE)$(SHARED) $(TMP)/$(LIBFILE)$(STATIC) tmpheaders
-
-# Create temp directory
-$(TMP):
-       mkdir -p $@
-
-# Dynamic library
-$(TMP)/$(LIBFILE)$(SHARED): $(OBJS)
-       echo "Compiling $(notdir $@)"
-       $(CXX) $^ -shared -o $@ $(LIB) $(LDFLAGS)
-
-# Static library
-$(TMP)/$(LIBFILE)$(STATIC): $(OBJS)
-       echo "Compiling $(notdir $@)"
-       $(AR) rcs $@ $^
-
-# Copy headers to temp
-.PHONY: tmpheaders
-tmpheaders: $(TMP)/$(pkgincludedir)
-       $(foreach SUBDIR, $(SUBDIRS), \
-               mkdir -p $</$(SUBDIR) ; \
-               $(CP) -R $(SRC)/$(SUBDIR)/*.h $</$(SUBDIR) ; \
-       )
-#      $(foreach SUBDIR, $(SUBDIRS), $(CP) -r $(SRC)/$(SUBDIR)/*.h $</$(SUBDIR))
-
-$(TMP)/$(pkgincludedir):
-       mkdir -p $@
-
-# Library object file
-$(TMP)/%.o: $(SRC)/%.cpp $(wildcard $(SRC)/*.h)
-       mkdir -p $(dir $@)
-       echo "Compiling $(NAME)/$(notdir $(basename $@))"
-       $(CXX) $(PIC) $(CXXFLAGS) -c $< -o $@
-
-# Installs
-.PHONY: install
-install: install_lib 
-
-$(TGT)/$(pkgincludedir):
-       mkdir -p $@
-
-$(TGT)/$(libdir):
-       mkdir -p $@
-
-.PHONY: install_headers
-install_headers: $(TGT)/$(pkgincludedir)
-       echo "Installing $(NAME) headers to $<"
-       $(foreach SUBDIR, $(SUBDIRS), $(CP) $(SRC)/$(SUBDIR)/*.h $</$(SUBDIR))
-
-.PHONY: install_lib
-install_lib: $(TGT)/$(libdir) $(TMP)/$(LIBFILE)$(SHARED)
-       echo "Installing dynamic library to $<"
-       $(CP) $(TMP)/$(LIBFILE)$(SHARED) $<
-
-.PHONY: install_staticlib
-install_staticlib: $(TGT)/$(libdir) $(TMP)/$(LIBFILE)$(STATIC)
-       echo "Installing static library to $<"
-       $(CP) $(TMP)/$(LIBFILE)$(STATIC) $<
index 7ac634d9a30c9ef9c8f8dec01633b5c950c96ef8..ddd2cb5167d57f0e3f5df614a8caf3ad3b68dc50 100644 (file)
@@ -7,6 +7,9 @@ Distributed under the LGPL
 
 #include <sstream>
 #include <cstring>
+#ifdef WIN32
+#include <windows.h>
+#endif
 #include "except.h"
 
 using namespace std;
@@ -36,7 +39,11 @@ string SystemError::build_what(const string &w, int e)
        ostringstream buf;
        buf<<w<<": ";
 #ifdef WIN32
-       buf<<e;
+       char msg[1024];
+       if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, e, 0, msg, sizeof(msg), 0))
+               buf<<msg;
+       else
+               buf<<e;
 #else
        buf<<strerror(e);
 #endif