Don't define _GNU_SOURCE if it's already defined on the command-line.
[amitay/samba.git] / pidl / lib / Parse / Pidl / Samba4 / NDR / Parser.pm
index af6885f67a6815d94cd89c4485a2fee8168471d5..0e4a7e22894b6b12ef01dd4890e2fed723c45cf2 100644 (file)
@@ -2548,7 +2548,9 @@ sub GenerateIncludes($)
        if (is_intree()) {
                $self->pidl("#include \"includes.h\"");
        } else {
+               $self->pidl("#ifndef _GNU_SOURCE");
                $self->pidl("#define _GNU_SOURCE");
+               $self->pidl("#endif");
                $self->pidl("#include <stdint.h>");
                $self->pidl("#include <stdlib.h>");
                $self->pidl("#include <stdio.h>");