Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/cassert

    r7dcce0a r7bbf91e  
    11/*
    2  * Copyright (c) 2019 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_CASSERT
    3131
     32#include <__bits/common.hpp>
    3233
    33 extern "C" {
    34     #include <assert.h>
     34namespace std::hel
     35{
     36    extern "C" {
     37        #include <assert.h>
     38    }
    3539}
    3640
    37 // TODO: For some reason, this function isn't visible (maybe the
    38 //       noreturn attribute?), adding a redeclaration here for the
    39 //       time being.
     41namespace std
     42{
     43    // Note: The only thing imported is assert
     44    //       and that is a macro.
     45}
    4046
    41 extern void __helenos_assert_abort(const char *, const char *, unsigned int);
    42 
    43 #define __unimplemented() assert(!"Not implemented!")
     47/**
     48 * We need to fix the assert macro because it uses
     49 * a non-standard function that we have in the
     50 * std::hel namespace.
     51 */
     52#undef assert
     53#define assert(expr) \
     54        do { \
     55                if (!(expr)) \
     56                        std::hel::assert_abort(#expr, __FILE__, __LINE__); \
     57        } while (0)
    4458
    4559#endif
Note: See TracChangeset for help on using the changeset viewer.