From 4bd0c4c5ee47378e0eabaa7cbc88a5d1c6c30a17 Mon Sep 17 00:00:00 2001 From: peizhilin Date: Fri, 9 Nov 2018 15:14:33 +0800 Subject: [PATCH] test=develop --- paddle/fluid/platform/port.h | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/paddle/fluid/platform/port.h b/paddle/fluid/platform/port.h index 4ff07edc195..347622f212f 100644 --- a/paddle/fluid/platform/port.h +++ b/paddle/fluid/platform/port.h @@ -24,42 +24,42 @@ #include "glog/logging.h" #if !defined(_WIN32) -#define UNUSED __attribute__((unused)) -#include // dladdr -#include // backtrace -#include -#include // std::accumulate + #define UNUSED __attribute__((unused)) + #include // dladdr + #include // backtrace + #include + #include // std::accumulate #else -#include -#include // _popen, _pclose -#include -#include // std::accumulate in msvc -// windows version of __attribute__((unused)) -#define UNUSED __pragma(warning(suppress : 4100)) - -#ifndef S_ISDIR // windows port for sys/stat.h -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif // S_ISDIR - -static void *dlsym(void *handle, const char *symbol_name) { - FARPROC found_symbol; - found_symbol = GetProcAddress((HMODULE)handle, symbol_name); - - if (found_symbol == NULL) { - throw std::runtime_error(std::string(symbol_name) + " not found."); - } - return reinterpret_cast(found_symbol); -} + #include + #include // _popen, _pclose + #include + #include // std::accumulate in msvc + // windows version of __attribute__((unused)) + #define UNUSED __pragma(warning(suppress : 4100)) + + #ifndef S_ISDIR // windows port for sys/stat.h + #define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) + #endif // S_ISDIR + + static void *dlsym(void *handle, const char *symbol_name) { + FARPROC found_symbol; + found_symbol = GetProcAddress((HMODULE)handle, symbol_name); + + if (found_symbol == NULL) { + throw std::runtime_error(std::string(symbol_name) + " not found."); + } + return reinterpret_cast(found_symbol); + } -static void *dlopen(const char *filename, int flag) { - std::string file_name(filename); - file_name.replace(0, file_name.size() - 1, '/', '\\'); - HMODULE hModule = LoadLibrary(file_name.c_str()); - if (!hModule) { - throw std::runtime_error(file_name + " not found."); - } - return reinterpret_cast(hModule); -} + static void *dlopen(const char *filename, int flag) { + std::string file_name(filename); + file_name.replace(0, file_name.size() - 1, '/', '\\'); + HMODULE hModule = LoadLibrary(file_name.c_str()); + if (!hModule) { + throw std::runtime_error(file_name + " not found."); + } + return reinterpret_cast(hModule); + } #endif // !_WIN32 -- GitLab