Skip to content

Silence #if/#elif warnings originating from Windows header files #2455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
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: 6 additions & 0 deletions src/goto-cc/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ Date: June 2006
#endif

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <direct.h>
#include <windows.h>
#define chdir _chdir
#define popen _popen
#define pclose _pclose
#include <util/pragma_pop.def>
#endif

/// reads and source and object files, compiles and links them into goto program
Expand Down
6 changes: 6 additions & 0 deletions src/util/cout_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ Author: Daniel Kroening, kroening@kroening.com
#include <iostream>

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include <cstdio>
#include <util/pragma_pop.def>
#endif

#include "unicode.h"
Expand Down
6 changes: 6 additions & 0 deletions src/util/file_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ Date: January 2012
#endif

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <io.h>
#include <windows.h>
#include <direct.h>
#include <util/unicode.h>
#define chdir _chdir
#define popen _popen
#define pclose _pclose
#include <util/pragma_pop.def>
#endif

/// \return current working directory
Expand Down
6 changes: 6 additions & 0 deletions src/util/memory_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ Author: Daniel Kroening, kroening@kroening.com
#endif

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <windows.h>
#include <psapi.h>
#include <util/pragma_pop.def>
#endif

#include <ostream>
Expand Down
6 changes: 6 additions & 0 deletions src/util/tempdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ Author: CM Wintersteiger
#include "tempdir.h"

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <windows.h>
#include <io.h>
#include <direct.h>
#include <util/pragma_pop.def>
#endif

#include <cstdlib>
Expand Down
6 changes: 6 additions & 0 deletions src/util/tempfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Author: Daniel Kroening
#include "tempfile.h"

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <process.h>
#include <sys/stat.h>
#include <windows.h>
Expand All @@ -17,6 +22,7 @@ Author: Daniel Kroening
#define getpid _getpid
#define open _open
#define close _close
#include <util/pragma_pop.def>
#endif

#include <fcntl.h>
Expand Down
6 changes: 6 additions & 0 deletions src/util/unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ Author: Daniel Kroening, kroening@kroening.com
#include <cstdint>

#ifdef _WIN32
#include <util/pragma_push.def>
#ifdef _MSC_VER
#pragma warning(disable:4668)
// using #if/#elif on undefined macro
#endif
#include <windows.h>
#include <util/pragma_pop.def>
#endif

std::string narrow(const wchar_t *s)
Expand Down