~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/lib/libcxx/exception.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
//
8
8
//===----------------------------------------------------------------------===//
9
9
#include <stdlib.h>
 
10
#include <stdio.h>
10
11
 
11
12
#include "exception"
12
13
 
77
78
    return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
78
79
}
79
80
 
80
 
#ifndef EMSCRIPTEN // We provide this in JS
 
81
#ifndef __EMSCRIPTEN__ // We provide this in JS
81
82
_LIBCPP_NORETURN
82
83
void
83
84
terminate() _NOEXCEPT
88
89
#endif  // _LIBCPP_NO_EXCEPTIONS
89
90
        (*get_terminate())();
90
91
        // handler should not return
 
92
        printf("terminate_handler unexpectedly returned\n");
91
93
        ::abort ();
92
94
#ifndef _LIBCPP_NO_EXCEPTIONS
93
95
    }
94
96
    catch (...)
95
97
    {
96
98
        // handler should not throw exception
 
99
        printf("terminate_handler unexpectedly threw an exception\n");
97
100
        ::abort ();
98
101
    }
99
102
#endif  // _LIBCPP_NO_EXCEPTIONS
100
103
}
101
 
#endif // !EMSCRIPTEN
 
104
#endif // !__EMSCRIPTEN__
102
105
#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
103
106
 
104
 
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN)
 
107
#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(__EMSCRIPTEN__)
105
108
bool uncaught_exception() _NOEXCEPT
106
109
{
107
110
#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION)
109
112
    return __cxa_uncaught_exception();
110
113
#else  // __APPLE__
111
114
    #warning uncaught_exception not yet implemented
 
115
    printf("uncaught_exception not yet implemented\n");
112
116
    ::abort();
113
117
#endif  // __APPLE__
114
118
}
146
150
    __cxa_decrement_exception_refcount(__ptr_);
147
151
#else
148
152
    #warning exception_ptr not yet implemented
 
153
    printf("exception_ptr not yet implemented\n");
149
154
    ::abort();
150
155
#endif  // __APPLE__
151
156
}
157
162
    __cxa_increment_exception_refcount(__ptr_);
158
163
#else
159
164
    #warning exception_ptr not yet implemented
 
165
    printf("exception_ptr not yet implemented\n");
160
166
    ::abort();
161
167
#endif  // __APPLE__
162
168
}
173
179
    return *this;
174
180
#else  // __APPLE__
175
181
    #warning exception_ptr not yet implemented
 
182
    printf("exception_ptr not yet implemented\n");
176
183
    ::abort();
177
184
#endif  // __APPLE__
178
185
}
207
214
    return ptr;
208
215
#else  // __APPLE__
209
216
    #warning exception_ptr not yet implemented
 
217
    printf("exception_ptr not yet implemented\n");
210
218
    ::abort();
211
219
#endif  // __APPLE__
212
220
}
220
228
    terminate();
221
229
#else  // __APPLE__
222
230
    #warning exception_ptr not yet implemented
 
231
    printf("exception_ptr not yet implemented\n");
223
232
    ::abort();
224
233
#endif  // __APPLE__
225
234
}