Skip to content

Commit 5c169ab

Browse files
committed
config lib for compile inder ubuntu
1 parent bccf7f6 commit 5c169ab

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
cmake_minimum_required(VERSION 3.13.4)
1414

15-
project(libft)
15+
set(CMAKE_C_COMPILER "/usr/bin/clang")
16+
17+
project(libft C)
1618

1719
set(BUILD_FLAGS "-O3 -Wall -Wextra")
1820
set(BUILD_FLAGS "-O3 -Wall -Wextra -Werror")

includes/ft_diff_utils.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: Kashnitskiy <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/11/26 19:04:10 by mtrisha #+# #+# */
9-
/* Updated: 2020/01/30 18:07:52 by Kashnitskiy ### ########.fr */
9+
/* Updated: 2020/03/17 14:20:06 by Kashnitskiy ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -15,6 +15,10 @@
1515

1616
# include <string.h>
1717

18+
# ifdef __linux__
19+
# include <stdint.h>
20+
# endif
21+
1822
# define ABS(value) (((value) < 0) ? ((value) * (-1)) : (value))
1923

2024
void ft_print_memory(const void *addr, size_t size);

includes/ft_list_on_arr.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: Kashnitskiy <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/12/22 18:31:03 by mtrisha #+# #+# */
9-
/* Updated: 2020/03/01 14:09:39 by Kashnitskiy ### ########.fr */
9+
/* Updated: 2020/03/17 14:23:14 by Kashnitskiy ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -15,6 +15,10 @@
1515

1616
# include <string.h>
1717

18+
# ifdef __linux__
19+
# include <stdint.h>
20+
# endif
21+
1822
typedef struct s_alst_item
1923
{
2024
size_t self;

includes/libft.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: Kashnitskiy <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/09/03 22:15:30 by mtrisha #+# #+# */
9-
/* Updated: 2020/03/01 13:37:19 by Kashnitskiy ### ########.fr */
9+
/* Updated: 2020/03/17 14:19:52 by Kashnitskiy ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -30,6 +30,10 @@
3030
*/
3131
# define PTR_SIZE __SIZEOF_POINTER__
3232

33+
# ifdef __linux__
34+
# include <stdint.h>
35+
# endif
36+
3337
# include <ft_libft_mod.h>
3438
# include <ft_compiler.h>
3539
# include <ft_libc.h>

sources/ft_libc/ft_strlcat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
/* By: Kashnitskiy <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/09/05 18:32:10 by mtrisha #+# #+# */
9-
/* Updated: 2020/01/16 13:56:55 by Kashnitskiy ### ########.fr */
9+
/* Updated: 2020/03/17 14:22:19 by Kashnitskiy ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include <ft_libc.h>
1414

15-
#ifdef USE_LIBC
15+
#if defined USE_LIBC && ! defined __linux__
1616

1717
inline size_t ft_strlcat(char *dst, const char *src, size_t size)
1818
{

sources/ft_libc/ft_strnstr.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
/* By: Kashnitskiy <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/09/05 21:34:28 by mtrisha #+# #+# */
9-
/* Updated: 2020/01/16 13:56:59 by Kashnitskiy ### ########.fr */
9+
/* Updated: 2020/03/17 14:22:40 by Kashnitskiy ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include <ft_libc.h>
1414

15-
#ifdef USE_LIBC
15+
#if defined USE_LIBC && ! defined __linux__
1616

1717
inline char *ft_strnstr(const char *haystack, const char *needle, size_t len)
1818
{

0 commit comments

Comments
 (0)