diff --git a/mongoose.c b/mongoose.c
index b7e5b32860e169c65f75a30cc28ef8469ac9efa2..6169793abc0f8b46e9250f8bf050e9cb012f51b4 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -4113,15 +4113,15 @@ static uint32_t mg_ws_random_mask(void) {
  * is untrusted code that wouldn't have access to a lower level net API
  * anyway (e.g. web browsers). Hence this feature is low prio for most
  * mongoose use cases and thus can be disabled, e.g. when porting to a platform
- * that lacks random().
+ * that lacks rand().
  */
 #ifdef MG_DISABLE_WS_RANDOM_MASK
   mask = 0xefbeadde; /* generated with a random number generator, I swear */
 #else
   if (sizeof(long) >= 4) {
-    mask = (uint32_t) random();
+    mask = (uint32_t) rand();
   } else if (sizeof(long) == 2) {
-    mask = (uint32_t) random() << 16 | (uint32_t) random();
+    mask = (uint32_t) rand() << 16 | (uint32_t) rand();
   }
 #endif
   return mask;
@@ -9568,10 +9568,6 @@ int gettimeofday(struct timeval *tp, void *tzp) {
   return 0;
 }
 
-long int random(void) {
-  return 42; /* FIXME */
-}
-
 void fprint_str(FILE *fp, const char *str) {
   while (*str != '\0') {
     if (*str == '\n') MAP_UARTCharPut(CONSOLE_UART, '\r');
@@ -9631,10 +9627,6 @@ int gettimeofday(struct timeval *tp, void *tzp) {
   return 0;
 }
 
-long int random(void) {
-  return 42; /* FIXME */
-}
-
 #endif /* CS_PLATFORM == CS_P_MSP432 */
 #ifdef MG_MODULE_LINES
 #line 1 "./src/../../common/platforms/simplelink/sl_fs_slfs.h"
diff --git a/mongoose.h b/mongoose.h
index 592914dbedb4f8eda3543b78a65caae8e915f8c4..12711a62e3d236477a0069a20e2a68a1e023caa8 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -151,7 +151,6 @@
 #include <sys/stat.h>
 #include <time.h>
 
-#define random() rand()
 #ifdef _MSC_VER
 #pragma comment(lib, "ws2_32.lib") /* Linking with winsock library */
 #endif
@@ -187,7 +186,6 @@
 #else
 #define fseeko(x, y, z) fseek((x), (y), (z))
 #endif
-#define random() rand()
 typedef int socklen_t;
 #if _MSC_VER >= 1700
 #include <stdint.h>
@@ -460,8 +458,6 @@ int asprintf(char **strp, const char *fmt, ...);
 
 #endif
 
-long int random(void);
-
 /* TI's libc does not have stat & friends, add them. */
 #ifdef __TI_COMPILER_VERSION__
 
@@ -582,8 +578,6 @@ struct SlTimeval_t;
 int gettimeofday(struct timeval *t, void *tz);
 #endif
 
-long int random(void);
-
 /* TI's libc does not have stat & friends, add them. */
 #ifdef __TI_COMPILER_VERSION__