Commit c5b2eb22221144620fd80cacce8c9542c83fc072
authorMichel Pollet <buserror@gmail.com>
Tue, 25 Apr 2017 07:23:42 +0000 (08:23 +0100)
committerMichel Pollet <buserror@gmail.com>
Tue, 25 Apr 2017 07:23:42 +0000 (08:23 +0100)
Why isn't this in the standard C library, I wonder.

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/sim_vcd_file.c

index 10dc273852409a7ce663c2e43f449c202e747943..f0d80be607aaeb103e00790e37135735fa8f68c6 100644 (file)
@@ -21,7 +21,7 @@
        You should have received a copy of the GNU General Public License
        along with simavr.  If not, see <http://www.gnu.org/licenses/>.
  */
-#define _GNU_SOURCE /* for strdupa */
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -34,6 +34,8 @@
 
 DEFINE_FIFO(avr_vcd_log_t, avr_vcd_fifo);
 
+#define strdupa(__s) strcpy(alloca(strlen(__s)+1), __s)
+
 static void
 _avr_vcd_notify(
                struct avr_irq_t * irq,