Changeset 7dcce0a in mainline for uspace/lib/cpp/include/cassert


Ignore:
Timestamp:
2019-01-16T18:07:45Z (5 years ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4248ce5
Parents:
cf9e949
git-author:
Jaroslav Jindrak <dzejrou@…> (2019-01-12 15:09:49)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2019-01-16 18:07:45)
Message:

cpp: abort and report when an unimplemented function is called

File:
1 edited

Legend:

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

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