htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 38c45ec2f4dcdaff3a2f0c00f0f71f30e3bbeedb
parent 25358506f9851f165da5c80298d62c696e974aa8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 30 Oct 2020 12:29:22 +0100

Fix the "undefined strtok_r symbol" error

Depending on versions, GCC warned that the strtok_r symbol was
undefined. strtok_r was thus assumed to return an integer rather than a
char*, leading to strong issues since in 64-bits a char* is stored on 8
bytes while an integer is only 4 bytes length.

Diffstat:
Msrc/htrdr_ground.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/htrdr_ground.c b/src/htrdr_ground.c @@ -14,6 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#define _POSIX_C_SOURCE 200112L /* strtok_r support */ + #include "htrdr.h" #include "htrdr_interface.h" #include "htrdr_ground.h" @@ -33,6 +35,8 @@ #include <star/s3d.h> +#include <string.h> /* strtok_r */ + /* Define the hash table that maps an Obj vertex id to its position into the * vertex buffer */ #define HTABLE_NAME vertex