mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-06 03:59:31 +01:00
pbot-vm: add C2X language files; default cc
to C2X
This commit is contained in:
parent
23efee674a
commit
02ca5e4435
12
applets/pbot-vm/guest/lib/Languages/c2x.pm
Executable file
12
applets/pbot-vm/guest/lib/Languages/c2x.pm
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package c2x;
|
||||
use parent '_c_base';
|
||||
|
||||
1;
|
12
applets/pbot-vm/guest/lib/Languages/clang2x.pm
Executable file
12
applets/pbot-vm/guest/lib/Languages/clang2x.pm
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package clang2x;
|
||||
use parent '_c_base';
|
||||
|
||||
1;
|
@ -219,7 +219,7 @@ sub configure_context($context, $config) {
|
||||
# set any undefined values to default values
|
||||
$context->{nick} //= 'vm';
|
||||
$context->{channel} //= 'vm';
|
||||
$context->{lang} //= 'c11';
|
||||
$context->{lang} //= 'c2x';
|
||||
$context->{'vm-serial'} //= SERIAL;
|
||||
$context->{'vm-cid'} //= CID;
|
||||
$context->{'vm-vport'} //= VPORT;
|
||||
|
64
applets/pbot-vm/host/lib/Languages/c2x.pm
Executable file
64
applets/pbot-vm/host/lib/Languages/c2x.pm
Executable file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Languages::c2x;
|
||||
use parent 'Languages::_c_base';
|
||||
|
||||
sub initialize {
|
||||
my ($self, %conf) = @_;
|
||||
|
||||
$self->{sourcefile} = 'prog.c';
|
||||
$self->{execfile} = 'prog';
|
||||
$self->{default_options} = '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c2x -lm -Wfatal-errors -fsanitize=alignment,undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer';
|
||||
$self->{options_paste} = '-fdiagnostics-show-caret';
|
||||
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
|
||||
$self->{cmdline} = 'gcc -gdwarf-2 -g3 $sourcefile $options -o $execfile';
|
||||
|
||||
$self->{prelude} = <<'END';
|
||||
#define _XOPEN_SOURCE 9001
|
||||
#define __USE_XOPEN
|
||||
|
||||
#include <assert.h>
|
||||
#include <complex.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fenv.h>
|
||||
#include <float.h>
|
||||
#include <inttypes.h>
|
||||
#include <iso646.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdatomic.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdnoreturn.h>
|
||||
#include <string.h>
|
||||
#include <tgmath.h>
|
||||
#include <threads.h>
|
||||
#include <time.h>
|
||||
#include <uchar.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <prelude.h>
|
||||
|
||||
END
|
||||
}
|
||||
|
||||
1;
|
64
applets/pbot-vm/host/lib/Languages/clang2x.pm
Executable file
64
applets/pbot-vm/host/lib/Languages/clang2x.pm
Executable file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
package Languages::clang2x;
|
||||
use parent 'Languages::_c_base';
|
||||
|
||||
sub initialize {
|
||||
my ($self, %conf) = @_;
|
||||
|
||||
$self->{sourcefile} = 'prog.c';
|
||||
$self->{execfile} = 'prog';
|
||||
$self->{default_options} = '-Wextra -Wall -Wno-unused -Wno-unused-parameter -pedantic -Wfloat-equal -Wshadow -std=c2x -lm -Wfatal-errors -fsanitize=integer,alignment,undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer';
|
||||
$self->{options_paste} = '-fdiagnostics-show-caret';
|
||||
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
|
||||
$self->{cmdline} = 'clang -gdwarf-2 -g3 $sourcefile $options -o $execfile';
|
||||
|
||||
$self->{prelude} = <<'END';
|
||||
#define _XOPEN_SOURCE 9001
|
||||
#define __USE_XOPEN
|
||||
|
||||
#include <assert.h>
|
||||
#include <complex.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fenv.h>
|
||||
#include <float.h>
|
||||
#include <inttypes.h>
|
||||
#include <iso646.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdatomic.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdnoreturn.h>
|
||||
#include <string.h>
|
||||
#include <tgmath.h>
|
||||
#include <threads.h>
|
||||
#include <time.h>
|
||||
#include <uchar.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <prelude.h>
|
||||
|
||||
END
|
||||
}
|
||||
|
||||
1;
|
Loading…
Reference in New Issue
Block a user