Skip to content

Commit

Permalink
Don't require stdbool.h in openslide.h
Browse files Browse the repository at this point in the history
fc61589 was overzealous about reintroducing stdbool.h: we can assume it
exists when compiling OpenSlide, but not when compiling programs that use
it, since those may build with MSVC.

The logic removed in that commit was incorrect, so we don't reintroduce
it here.  (It assumed HAVE_STDBOOL_H was available from someone's
config.h, and also assumed bool is 4 bytes instead of the more likely 1.)
Instead, assume for now that MSVC is the only compiler without C99
support.

Closes #115.
  • Loading branch information
bgilbert committed Apr 11, 2013
1 parent cace7c4 commit 1cae453
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/openslide-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@
#define OPENSLIDE_OPENSLIDE_FEATURES_H_


#ifndef __cplusplus
# ifdef _MSC_VER
# ifndef bool
# define bool unsigned char
# endif
# ifndef true
# define true 1
# endif
# ifndef false
# define false 0
# endif
# ifndef __bool_true_false_are_defined
# define __bool_true_false_are_defined 1
# endif
# else
# include <stdbool.h>
# endif
#endif


// for exporting from shared libraries or DLLs
#if defined _WIN32
# ifdef _OPENSLIDE_BUILDING_DLL
Expand Down
1 change: 0 additions & 1 deletion src/openslide.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 1cae453

Please sign in to comment.