---
 freebsd/contrib/ptpd/src/ptpd.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/freebsd/contrib/ptpd/src/ptpd.h b/freebsd/contrib/ptpd/src/ptpd.h
index 08090317..387d6525 100644
--- a/freebsd/contrib/ptpd/src/ptpd.h
+++ b/freebsd/contrib/ptpd/src/ptpd.h
@@ -183,12 +183,21 @@
 
 
 /* NOTE: this macro can be refactored into a function */
+#ifndef __rtems__
 #define XMALLOC(ptr,size) \
        if(!((ptr)=malloc(size))) { \
                PERROR("failed to allocate memory"); \
                ptpdShutdown(ptpClock); \
                exit(1); \
        }
+#else /* __rtems__ */
+#define XMALLOC(ptr,size) \
+     if(!((ptr)=rtems_malloc(size))) { \
+             PERROR("failed to allocate memory"); \
+             ptpdShutdown(ptpClock); \
+             exit(1); \
+     }
+#endif /* __rtems__ */
 
 #define SAFE_FREE(pointer) \
        if(pointer != NULL) { \
-- 
2.25.1

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to