blob: 1e9594dedce1142c2be650bb7ab6eaf1cbf3748d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/File.h>
#include <LibCpp/Preprocessor.h>
int main(int, char**)
{
auto file = Core::File::construct("/home/anon/Source/little/other.h");
if (!file->open(Core::OpenMode::ReadOnly)) {
perror("open");
exit(1);
}
auto content = file->read_all();
Cpp::Preprocessor cpp("other.h", StringView { content });
dbgln("{}", cpp.process());
}
|