Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/include/llvm/BinaryFormat/Magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef LLVM_BINARYFORMAT_MAGIC_H
#define LLVM_BINARYFORMAT_MAGIC_H

#include "llvm/Support/Compiler.h"

#include <system_error>

namespace llvm {
Expand Down Expand Up @@ -72,15 +74,15 @@ struct file_magic {
};

/// Identify the type of a binary file based on how magical it is.
file_magic identify_magic(StringRef magic);
LLVM_ABI file_magic identify_magic(StringRef magic);

/// Get and identify \a path's type based on its content.
///
/// @param path Input path.
/// @param result Set to the type of file, or file_magic::unknown.
/// @returns errc::success if result has been successfully set, otherwise a
/// platform-specific error_code.
std::error_code identify_magic(const Twine &path, file_magic &result);
LLVM_ABI std::error_code identify_magic(const Twine &path, file_magic &result);
} // namespace llvm

#endif