util: implement strndup for WIN32
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Mon, 28 Sep 2015 12:23:34 +0000 (14:23 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 29 Sep 2015 08:03:47 +0000 (10:03 +0200)
commitbea66d22f2c0e97242c15652376ae4e82779f343
tree500a6cc0c77ff534d40b3a32619ef2bc34c1f2b1
parent7efb2350199f7ea5acbadb76a1a19eda75b45a45
util: implement strndup for WIN32

v2:
- Add strndup.h to Makefile.sources (Emil)
- Use calloc instead of malloc (Emil).
- Check if allocation fails (Emil, Jose)
- Add '#pragma once' and include stdlib.h to strndup.h (Jose)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92124
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/main/shader_query.cpp
src/util/Makefile.sources
src/util/strndup.c [new file with mode: 0644]
src/util/strndup.h [new file with mode: 0644]