The tdb2 tools should #include "config.h" before tdb2.h (about to
become a requirement) and use libreplace where available.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
#include "tdb2.h"
#include "system/filesys.h"
#include "tdb2.h"
#include "system/filesys.h"
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#include <system/locale.h>
+#else
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
static void print_data(TDB_DATA d)
{
static void print_data(TDB_DATA d)
{
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tdb2.h"
#include <assert.h>
#include "tdb2.h"
#include <assert.h>
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#else
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#define debug_fprintf(file, fmt, ...) do {/*nothing*/} while (0)
#define debug_fprintf(file, fmt, ...) do {/*nothing*/} while (0)
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#include <system/time.h>
+#include <system/locale.h>
+#else
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
static int do_command(void);
const char *cmdname;
static int do_command(void);
const char *cmdname;
writers - that stresses the locking code.
*/
writers - that stresses the locking code.
*/
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#else
+#include <stdlib.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdio.h>
#include <getopt.h>
#include <stdarg.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <time.h>
#include <sys/wait.h>
/* Currently we default to creating a tdb1. This will change! */
#define TDB2_IS_DEFAULT false
/* Currently we default to creating a tdb1. This will change! */
#define TDB2_IS_DEFAULT false