Improve support for platforms without stddef.h. NULL definition should now be provided by architecture port file atomport.h, which in most cases can just include stddef.h.

This commit is contained in:
Kelvin Lawson
2011-05-25 23:52:11 +01:00
parent 89f8775011
commit be6e60bf2f
16 changed files with 14 additions and 17 deletions

View File

@@ -144,7 +144,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"

View File

@@ -34,6 +34,12 @@
/* Required number of system ticks per second (normally 100 for 10ms tick) */ /* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100 #define SYSTEM_TICKS_PER_SEC 100
/**
* Definition of NULL.
* If stddef.h is available on the platform it is simplest to include it
* from this header, otherwise define below.
*/
#define NULL ((void *)(0))
/** /**
* Architecture-specific types. * Architecture-specific types.

View File

@@ -37,6 +37,8 @@
/* Portable uint8_t and friends available from stdint.h on this platform */ /* Portable uint8_t and friends available from stdint.h on this platform */
#include <stdint.h> #include <stdint.h>
/* Definition of NULL is available from stddef.h on this platform */
#include <stddef.h>
/* Required number of system ticks per second (normally 100 for 10ms tick) */ /* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100 #define SYSTEM_TICKS_PER_SEC 100

View File

@@ -39,6 +39,8 @@
#include <intrins.h> #include <intrins.h>
#endif #endif
/* Definition of NULL is available from stddef.h on this platform */
#include <stddef.h>
/* Required number of system ticks per second (normally 100 for 10ms tick) */ /* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100 #define SYSTEM_TICKS_PER_SEC 100

View File

@@ -1,5 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <stddef.h>
#include "stm8s.h" #include "stm8s.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -27,7 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atommutex.h" #include "atommutex.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atommutex.h" #include "atommutex.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomtests.h" #include "atomtests.h"
#include "atommutex.h" #include "atommutex.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomqueue.h" #include "atomqueue.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomqueue.h" #include "atomqueue.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomsem.h" #include "atomsem.h"
#include "atomtests.h" #include "atomtests.h"

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomsem.h" #include "atomsem.h"
#include "atomtests.h" #include "atomtests.h"
@@ -321,4 +320,4 @@ static void testCallback (POINTER cb_data)
*/ */
} }
} }

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomsem.h" #include "atomsem.h"
#include "atomtimer.h" #include "atomtimer.h"
@@ -246,4 +245,4 @@ static void testCallback (POINTER cb_data)
*/ */
} }
} }

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomsem.h" #include "atomsem.h"
#include "atomtimer.h" #include "atomtimer.h"
@@ -240,4 +239,4 @@ static void testCallback (POINTER cb_data)
*/ */
} }
} }

View File

@@ -28,7 +28,6 @@
*/ */
#include <stddef.h>
#include "atom.h" #include "atom.h"
#include "atomsem.h" #include "atomsem.h"
#include "atomtimer.h" #include "atomtimer.h"
@@ -138,4 +137,4 @@ static void testCallback (POINTER cb_data)
{ {
/* Callback was called */ /* Callback was called */
callback_ran_flag = TRUE; callback_ran_flag = TRUE;
} }