aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-24 14:23:58 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-24 14:23:58 +0200
commit3bc9f9e17a36ff034a01f72bea42472067ed983e (patch)
tree8fbb99ff2dd27551f1ce305c3f10d24a1019b237
parentMakefile compliant with vm (diff)
download42-cub3d-3bc9f9e17a36ff034a01f72bea42472067ed983e.tar.gz
42-cub3d-3bc9f9e17a36ff034a01f72bea42472067ed983e.tar.bz2
42-cub3d-3bc9f9e17a36ff034a01f72bea42472067ed983e.tar.xz
42-cub3d-3bc9f9e17a36ff034a01f72bea42472067ed983e.tar.zst
42-cub3d-3bc9f9e17a36ff034a01f72bea42472067ed983e.zip
Test
-rw-r--r--Makefile2
-rw-r--r--inc/cub3d_defines.h6
-rw-r--r--src/ft_exit.c26
3 files changed, 19 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 8ccb29c..cc6c3ee 100644
--- a/Makefile
+++ b/Makefile
@@ -229,7 +229,7 @@ endif
ifeq (${OS}, Darwin)
${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_DIR} -lft -lmlx -lm -lpthread -framework OpenGL -framework AppKit
else ifeq (${OS}, Linux)
- ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -lft -L${MLX_GNU_DIR} -lmlx -L/usr/lib -lX11 -lXext -lm -lbsd -lpthread
+ ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -lft -L${MLX_GNU_DIR} -lmlx -lX11 -lXext -lm -lbsd -lpthread
else
${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_BSD_DIR} -L/usr/local/lib -lft -lX11 -lXext -lmlx -lm -lpthread
endif
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h
index da9ae93..66dbdc1 100644
--- a/inc/cub3d_defines.h
+++ b/inc/cub3d_defines.h
@@ -165,7 +165,11 @@ enum
# endif
# if FT_OS == 1
# define FT_SND_TERM_CMD "pkill -SIGTERM afplay"
-# else
+# endif
+# if FT_OS == 2
+# define FT_SND_TERM_CMD "pkill -SIGTERM aplay"
+# endif
+# if FT_OS == 3
# define FT_SND_TERM_CMD "pkill -SIGTERM waveplay"
# endif
diff --git a/src/ft_exit.c b/src/ft_exit.c
index ea5cd2a..e0531c3 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -46,24 +46,24 @@ static void
if (clist->isoldmus && clist->wlist.inited)
{
- if (FT_OS == 2)
- {
- pthread_cancel(clist->mtid);
- pthread_join(clist->mtid, NULL);
- }
- else if (system(FT_SND_TERM_CMD))
+ /* if (FT_OS == 2) */
+ /* { */
+ /* pthread_cancel(clist->mtid); */
+ /* pthread_join(clist->mtid, NULL); */
+ /* } */
+ if (system(FT_SND_TERM_CMD))
return ;
}
i = -1;
while (++i < FT_TOTAL_SFX)
{
- pthread_mutex_unlock(&clist->sfx[i].mutex);
- if (FT_OS == 2)
- {
- pthread_cancel(clist->sfx[i].tid);
- pthread_join(clist->sfx[i].tid, NULL);
- }
- else if (system(FT_SND_TERM_CMD))
+ /* pthread_mutex_unlock(&clist->sfx[i].mutex); */
+ /* if (FT_OS == 2) */
+ /* { */
+ /* pthread_cancel(clist->sfx[i].tid); */
+ /* pthread_join(clist->sfx[i].tid, NULL); */
+ /* } */
+ if (system(FT_SND_TERM_CMD))
return ;
}
}