This adds missing includes for alloca. The man page of alloca(3) states that alloca.h should be #include'd to use alloca. Also work around missing alloca.h header on Windows by adding a compatibility module. Closes: #197tags/v1.9.13
| @@ -1,4 +1,5 @@ | |||||
| /* | /* | ||||
| Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com> | |||||
| Copyright (C) 2008-2011 Torben Horn | Copyright (C) 2008-2011 Torben Horn | ||||
| This program is free software; you can redistribute it and/or modify | This program is free software; you can redistribute it and/or modify | ||||
| @@ -16,9 +17,7 @@ along with this program; if not, write to the Free Software | |||||
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||||
| */ | */ | ||||
| #ifdef WIN32 | |||||
| #include <malloc.h> | |||||
| #endif | |||||
| #include <alloca.h> | |||||
| #include "JackNetOneDriver.h" | #include "JackNetOneDriver.h" | ||||
| #include "JackEngineControl.h" | #include "JackEngineControl.h" | ||||
| @@ -3,6 +3,7 @@ | |||||
| /* | /* | ||||
| NetJack Abstraction. | NetJack Abstraction. | ||||
| Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com> | |||||
| Copyright (C) 2008 Pieter Palmers <pieterpalmers@users.sourceforge.net> | Copyright (C) 2008 Pieter Palmers <pieterpalmers@users.sourceforge.net> | ||||
| Copyright (C) 2006 Torben Hohn <torbenh@gmx.de> | Copyright (C) 2006 Torben Hohn <torbenh@gmx.de> | ||||
| Copyright (C) 2003 Robert Ham <rah@bash.sh> | Copyright (C) 2003 Robert Ham <rah@bash.sh> | ||||
| @@ -25,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| $Id: net_driver.c,v 1.17 2006/04/16 20:16:10 torbenh Exp $ | $Id: net_driver.c,v 1.17 2006/04/16 20:16:10 torbenh Exp $ | ||||
| */ | */ | ||||
| #include <alloca.h> | |||||
| #include <math.h> | #include <math.h> | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <memory.h> | #include <memory.h> | ||||
| @@ -4,6 +4,7 @@ | |||||
| * | * | ||||
| * used by the driver and the jacknet_client | * used by the driver and the jacknet_client | ||||
| * | * | ||||
| * Copyright (C) 2019 Karl Linden <karl.j.linden@gmail.com> | |||||
| * Copyright (C) 2008 Marc-Olivier Barre <marco@marcochapeau.org> | * Copyright (C) 2008 Marc-Olivier Barre <marco@marcochapeau.org> | ||||
| * Copyright (C) 2008 Pieter Palmers <pieterpalmers@users.sourceforge.net> | * Copyright (C) 2008 Pieter Palmers <pieterpalmers@users.sourceforge.net> | ||||
| * Copyright (C) 2006 Torben Hohn <torbenh@gmx.de> | * Copyright (C) 2006 Torben Hohn <torbenh@gmx.de> | ||||
| @@ -38,6 +39,7 @@ | |||||
| #define _GNU_SOURCE | #define _GNU_SOURCE | ||||
| #endif | #endif | ||||
| #include <alloca.h> | |||||
| #include <math.h> | #include <math.h> | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <memory.h> | #include <memory.h> | ||||
| @@ -0,0 +1,7 @@ | |||||
| # Compatibility Module for alloca | |||||
| This module contains a replacement header for alloca. To use this module | |||||
| simply make sure to `#include <alloca.h>` in the file where alloca | |||||
| should be used. If the header is missing the path to the replacement | |||||
| header is added to the global include paths, so nothing more needs to be | |||||
| done. | |||||
| @@ -0,0 +1,34 @@ | |||||
| /* | |||||
| * alloca.h | |||||
| * | |||||
| * Replacement header for systems lacking the alloca.h header required | |||||
| * to use the alloca function. | |||||
| * | |||||
| * Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com> | |||||
| * | |||||
| * This program is free software; you can redistribute it and/or modify | |||||
| * it under the terms of the GNU Lesser General Public License as | |||||
| * published by the Free Software Foundation; either version 2.1 of the | |||||
| * License, or (at your option) any later version. | |||||
| * | |||||
| * This program is distributed in the hope that it will be useful, but | |||||
| * WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
| * Lesser General Public License for more details. | |||||
| * | |||||
| * You should have received a copy of the GNU Lesser General Public | |||||
| * License along with this program; if not, write to the Free Software | |||||
| * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |||||
| * USA. | |||||
| * | |||||
| */ | |||||
| #ifndef ALLOCA_H | |||||
| # define ALLOCA_H | |||||
| # if _MSC_VER | |||||
| # include <malloc.h> | |||||
| # define alloca _alloca | |||||
| # endif /* _MSC_VER */ | |||||
| #endif /* !ALLOCA_H */ | |||||
| @@ -0,0 +1,32 @@ | |||||
| #!/usr/bin/env python | |||||
| # encoding: utf-8 | |||||
| # | |||||
| # Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com> | |||||
| # | |||||
| # This program is free software; you can redistribute it and/or modify | |||||
| # it under the terms of the GNU General Public License as published by | |||||
| # the Free Software Foundation; either version 2 of the License. | |||||
| # | |||||
| # This program is distributed in the hope that it will be useful, | |||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| # GNU General Public License for more details. | |||||
| # | |||||
| # You should have received a copy of the GNU General Public License | |||||
| # along with this program; if not, write to the Free Software | |||||
| # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| # | |||||
| from waflib import Errors | |||||
| def options(opt): | |||||
| pass | |||||
| def configure(conf): | |||||
| try: | |||||
| conf.check(header_name='alloca.h') | |||||
| except Errors.ConfigurationError: | |||||
| conf.env.append_unique('INCLUDES', conf.path.abspath()) | |||||
| def build(bld): | |||||
| pass | |||||
| @@ -4,6 +4,7 @@ | |||||
| * as they would be used by many applications. | * as they would be used by many applications. | ||||
| */ | */ | ||||
| #include <alloca.h> | |||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <errno.h> | #include <errno.h> | ||||
| #include <unistd.h> | #include <unistd.h> | ||||
| @@ -1,6 +1,7 @@ | |||||
| /* | /* | ||||
| * session_notify.c -- ultra minimal session manager | * session_notify.c -- ultra minimal session manager | ||||
| * | * | ||||
| * Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com> | |||||
| * Copyright (C) 2010 Torben Hohn. | * Copyright (C) 2010 Torben Hohn. | ||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | ||||
| @@ -18,6 +19,7 @@ | |||||
| * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||||
| */ | */ | ||||
| #include <alloca.h> | |||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <errno.h> | #include <errno.h> | ||||
| #include <unistd.h> | #include <unistd.h> | ||||