Skip to content

Instantly share code, notes, and snippets.

@gchatelet
Created November 1, 2011 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gchatelet/1330474 to your computer and use it in GitHub Desktop.
Save gchatelet/1330474 to your computer and use it in GitHub Desktop.
NULL definition within stddef.h
/* A null pointer constant. */
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
#define NULL 0
#endif /* C++ */
#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment