]> sourceware.org Git - systemtap.git/commitdiff
stapdyn: -fstd=c++11 compatibility
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 2 Feb 2016 15:45:41 +0000 (10:45 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 2 Feb 2016 15:47:24 +0000 (10:47 -0500)
typeof() and auto_ptr() needed some #ifdef love so that the code
compiles with
     CXXFLAGS="-std=c++11 -O2 -g -Wextra -Wall -Werror"
and  CXXFLAGS="-O2 -g -Wextra -Wall -Werror"

stapdyn/dynprobe.h
stapdyn/mutator.h
stapdyn/stapdyn.cxx

index 042098abdc06be9575f3d82ca192c9f622e88427..3a7cf49585b0c55177389b7edb939c1a12711880 100644 (file)
@@ -16,6 +16,9 @@ extern "C" {
 #include <stdint.h>
 }
 
+#if __cplusplus >= 201103L /* -std=c++11 */
+#define typeof(x) decltype(x)
+#endif
 
 // The individual probes' info read from the stap module.
 struct dynprobe_location {
index 459cfc2c74ed8ed8dd4ca46e4e1fd33e09bea7dc..65c6160d7722c4b19c687591468f9bbdfc3775c3 100644 (file)
@@ -26,6 +26,9 @@ extern "C" {
 #include "../runtime/dyninst/stapdyn.h"
 }
 
+#if __cplusplus >= 201103L /* -std=c++11 */
+#define typeof(x) decltype(x)
+#endif
 
 // The mutator drives all instrumentation.
 class mutator {
index cb389f50414a510a47bdeb91c25fce936f9018ae..19ae8badf3914eaaaa698b1102b56d02389b1448 100644 (file)
@@ -145,7 +145,11 @@ main(int argc, char * const argv[])
   if (!check_dyninst_sebools(pid != 0))
     return 1;
 
+#if __cplusplus >= 201103L /* -std=c++11 */
+  unique_ptr<mutator> session(new mutator(module, modoptions));
+#else
   auto_ptr<mutator> session(new mutator(module, modoptions));
+#endif
   if (!session.get() || !session->load())
     {
       staperror() << "Failed to create the mutator!" << endl;
This page took 0.029255 seconds and 5 git commands to generate.