This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH, newlib] Allow locking routine to be retargeted
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>, newlib at sourceware dot org
- Date: Wed, 14 Dec 2016 15:21:46 +0100
- Subject: Re: [PATCH, newlib] Allow locking routine to be retargeted
- Authentication-results: sourceware.org; auth=none
- References: <34e2c2ad-be0f-44ed-201e-a6f294814f4e@foss.arm.com>
On 13/12/16 18:18, Thomas Preudhomme wrote:
+#else
+
+typedef void * _LOCK_T;
+#define _LOCK_RECURSIVE_T _LOCK_T
+
+#define __LOCK_INIT(class,lock) extern struct_lock _lock_ ## lock; \
+ class_LOCK_T lock = &_lock_ ## lock
+#define __LOCK_INIT_RECURSIVE(class,lock) __LOCK_INIT(class,lock)
I would use:
struct _lock;
typedef struct _lock *_LOCK_T;
This makes debugging a bit easier.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.