Skip to content

Commit

Permalink
recreate assert.h
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Jun 18, 2013
1 parent 99ffe01 commit 33a97d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 12 additions & 0 deletions assert.h
@@ -0,0 +1,12 @@
#ifndef ASSERT_H_
#define ASSERT_H_

extern void __assert_failure(const char *msg);

#define assert(X) do { \
if (!(X)) { \
__assert_failure("assert failed: " #X); \
} \
} while (0)

#endif
8 changes: 0 additions & 8 deletions stdlib.h
Expand Up @@ -8,14 +8,6 @@ typedef signed int time_t;

#define NULL ((void *) 0)

extern void __assert_failure(const char *msg);

#define assert(X) do { \
if (!(X)) { \
__assert_failure("assert failed: " #X); \
} \
} while (0)

extern time_t time(time_t *t);

extern void *malloc(size_t size);
Expand Down

0 comments on commit 33a97d3

Please sign in to comment.