[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why does stdio.h have to be included before readline/readline.h (ins
From: |
Peng Yu |
Subject: |
Re: Why does stdio.h have to be included before readline/readline.h (installed via homebrew) on macOS? |
Date: |
Wed, 19 May 2021 12:27:30 -0500 |
> FYI https://tiswww.case.edu/php/chet/readline/readline.html#SEC43
There are also extra headers included in the above example. The
minimally required ones tested on macOS and Linux are the following.
/* Standard include files. stdio.h is required. */
#include <stdlib.h>
//#include <string.h>
#ifdef __APPLE__
#include <unistd.h>
#endif
#include <locale.h>
/* Used for select(2) */
//#include <sys/types.h>
//#include <sys/select.h>
#ifdef __linux__
#include <signal.h>
#endif
#ifdef __APPLE__
#include <stdio.h>
#endif
/* Standard readline include files. */
#include <readline/readline.h>
#include <readline/history.h>
--
Regards,
Peng