/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */
SDL_mutex* SDL_CreateMutex(void)
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */
SDL_mutex* SDL_CreateMutex(void)
{
    try {
        SDL_mutex * mutex = new SDL_mutex;
        return mutex;
    } catch (std::system_error & ex) {
        SDL_SetError("unable to create a C++ mutex: code=%d; %s", ex.code(), ex.what());
        return NULL;
    } catch (std::bad_alloc &) {
        SDL_OutOfMemory();
        return NULL;
    }
}