3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 12:12:34 +01:00
pbot/applets/pbot-vm/host/lib/Languages/cpp.pm

118 lines
2.3 KiB
Perl
Raw Normal View History

2015-04-05 11:30:42 +02:00
#!/usr/bin/perl
2021-07-11 00:00:22 +02:00
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
# SPDX-License-Identifier: MIT
2015-04-05 11:30:42 +02:00
use warnings;
use strict;
package Languages::cpp;
use parent 'Languages::_c_base';
2015-04-05 11:30:42 +02:00
sub initialize {
my ($self, %conf) = @_;
$self->{name} = 'c++';
$self->{sourcefile} = 'prog.cpp';
$self->{execfile} = 'prog';
$self->{default_options} = '-std=c++14 -Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -lm -Wfatal-errors -fsanitize=alignment,undefined';
2015-04-05 11:30:42 +02:00
$self->{options_paste} = '-fdiagnostics-show-caret';
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
2015-07-17 09:33:04 +02:00
$self->{cmdline} = 'g++ -ggdb -g3 $sourcefile $options -o $execfile';
2015-04-05 11:30:42 +02:00
$self->{prelude} = <<'END';
#if 0
2015-04-05 11:30:42 +02:00
#define _XOPEN_SOURCE 9001
#define __USE_XOPEN
#include <algorithm>
#include <fstream>
#include <list>
#include <regex>
#include <tuple>
#include <array>
#include <functional>
#include <locale>
#include <scoped_allocator>
#include <type_traits>
#include <atomic>
#include <future>
#include <map>
#include <set>
#include <typeindex>
#include <bitset>
#include <initializer_list>
#include <memory>
#include <sstream>
#include <typeinfo>
#include <chrono>
#include <iomanip>
#include <mutex>
#include <stack>
#include <unordered_map>
#include <codecvt>
#include <ios>
#include <new>
#include <stdexcept>
#include <unordered_set>
#include <complex>
#include <iosfwd>
#include <numeric>
#include <streambuf>
#include <utility>
#include <condition_variable>
2015-04-05 11:30:42 +02:00
#include <iostream>
#include <ostream>
#include <string>
#include <valarray>
#include <deque>
#include <istream>
#include <queue>
2015-04-05 11:30:42 +02:00
#include <vector>
#include <exception>
#include <iterator>
#include <system_error>
#include <forward_list>
#include <iostream>
#include <limits>
#include <ratio>
#include <thread>
#include <cassert>
#include <cinttypes>
#include <csignal>
2015-04-05 11:30:42 +02:00
#include <cstdio>
#include <cwchar>
#include <ccomplex>
#include <ciso646>
#include <cstdalign>
#include <cstdlib>
#include <cwctype>
#include <cctype>
#include <climits>
2015-04-05 11:30:42 +02:00
#include <cstdarg>
#include <cstring>
#include <cerrno>
#include <clocale>
#include <cstdbool>
#include <ctgmath>
#include <cfenv>
#include <cmath>
#include <cstddef>
#include <ctime>
#include <cfloat>
#include <csetjmp>
#include <cstdint>
2015-04-05 11:30:42 +02:00
#include <prelude.h>
using namespace std;
#endif
#include <prelude.hpp>
2015-04-05 11:30:42 +02:00
END
}
1;