summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp37
-rw-r--r--cpp/src/slice2cpp/Gen.h5
-rw-r--r--cpp/src/slice2cpp/Makefile15
3 files changed, 18 insertions, 39 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index fd34162a680..44e4b501637 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -214,12 +214,12 @@ Slice::Gen::Gen(const string& base, const string& headerExtension, const string&
Slice::Gen::~Gen()
{
- H << "\n\n#endif\n";
+ H << '\n';
C << '\n';
if(_impl)
{
- implH << "\n\n#endif\n";
+ implH << '\n';
implC << '\n';
}
}
@@ -280,15 +280,7 @@ Slice::Gen::generate(const UnitPtr& p)
}
FileTracker::instance()->addFile(fileImplC);
- string s = fileImplH;
- if(_include.size())
- {
- s = _include + '/' + s;
- }
- transform(s.begin(), s.end(), s.begin(), ToIfdef());
- implH << "#ifndef __" << s << "__";
- implH << "\n#define __" << s << "__";
- implH << '\n';
+ implH << "#pragma once\n";
}
string fileH = _base + "." + _headerExtension;
@@ -322,16 +314,7 @@ Slice::Gen::generate(const UnitPtr& p)
printHeader(C);
printGeneratedHeader(C, _base + ".ice");
-
- string s = fileH;
- if(_include.size())
- {
- s = _include + '/' + s;
- }
- transform(s.begin(), s.end(), s.begin(), ToIfdef());
- H << "\n#ifndef __" << s << "__";
- H << "\n#define __" << s << "__";
- H << '\n';
+ H << "#pragma once\n";
validateMetaData(p);
@@ -6045,18 +6028,6 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
H << nl << "// COMPILERFIX: The using directive avoid compiler warnings with -Woverloaded-virtual";
H << nl << "using ::IceInternal::IncomingAsync::ice_exception;";
H << nl << "virtual void ice_exception(const ::std::exception&);";
-
- H.zeroIndent();
- H << nl << "#if defined(__BCPLUSPLUS__)";
- H.restoreIndent();
- H << nl << "// COMPILERFIX: Avoid compiler warnings with C++Builder 2010";
- H << nl << "virtual void ice_exception()";
- H << sb;
- H << nl << "::IceInternal::IncomingAsync::ice_exception();";
- H << eb;
- H.zeroIndent();
- H << nl << "#endif";
- H.restoreIndent();
}
H << eb << ';';
diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h
index 9d05ca2a8b5..941b2a90e12 100644
--- a/cpp/src/slice2cpp/Gen.h
+++ b/cpp/src/slice2cpp/Gen.h
@@ -7,8 +7,7 @@
//
// **********************************************************************
-#ifndef GEN_H
-#define GEN_H
+#pragma once
#include <Slice/Parser.h>
#include <IceUtil/OutputUtil.h>
@@ -451,5 +450,3 @@ private:
};
}
-
-#endif
diff --git a/cpp/src/slice2cpp/Makefile b/cpp/src/slice2cpp/Makefile
index dc15e514e7e..167f35e7dc8 100644
--- a/cpp/src/slice2cpp/Makefile
+++ b/cpp/src/slice2cpp/Makefile
@@ -9,7 +9,13 @@
top_srcdir = ../..
-NAME = $(top_srcdir)/bin/slice2cpp
+include $(top_srcdir)/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ NAME = $(top_srcdir)/bin/slice2cpp.exe
+else
+ NAME = $(top_srcdir)/bin/slice2cpp
+endif
TARGETS = $(NAME)
@@ -22,10 +28,15 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I. $(CPPFLAGS)
+ifeq ($(MinGW), yes)
+$(NAME): $(OBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) -lslice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX) $(BASELIBS) $(MCPP_RPATH_LINK)
+else
$(NAME): $(OBJS)
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) -lSlice $(BASELIBS) $(MCPP_RPATH_LINK)
-
+endif
install:: all
$(call installprogram,$(NAME),$(install_bindir))