]> Dogcows Code - chaz/vimcoder/commitdiff
specify the std abort function in C++ driver
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 25 Jan 2013 05:23:35 +0000 (22:23 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 25 Jan 2013 05:23:35 +0000 (22:23 -0700)
This fixes a compile error in the C++ driver that occurs if the problem
function has any parameter named `exit', like problem #1965.

src/com/dogcows/resources/C++Driver

index 24ab333609ffa5ed8a51c9c80f0b32943fe2fb19..8161f636c8e8665e0d95dfbb684358da235d5c85 100644 (file)
@@ -138,11 +138,11 @@ bool __equals(const std::vector<double>& actual, const std::vector<double>& expe
 
 int main(int argc, char* argv[])
 {
-       bool    __exit_on_fail = false;
+       bool    __abort_on_fail = false;
        int     __pass = 0;
        int     __fail = 0;
 
-       if (1 < argc) __exit_on_fail = true;
+       if (1 < argc) __abort_on_fail = true;
 
        std::ifstream __in("testcases.txt");
        for(;;)
@@ -175,7 +175,7 @@ int main(int argc, char* argv[])
                                  << "   Actual: " << __actual << std::endl
                                  << " Expected: " << __expected << std::endl;
                        ++__fail;
-                       if (__exit_on_fail) exit(1);
+                       if (__abort_on_fail) std::abort();
                }
        }
 
This page took 0.026762 seconds and 4 git commands to generate.