audk/RedfishPkg/Library/JsonLib
Abner Chang 0cf260fabc RedfishPkg/JsonLib: Ignore the build error of conditional expression.
Ignore the build error of assignment within conditional expression.
Add build option to ignore the build error of "assignment within
conditional expression".
This build error is caused by the macros defined in open source
project jansson header file jansson.h.

- json_object_foreach
- json_object_foreach_safe
- json_array_foreach

We use build option to avoid the build errors on Visual Studio
(GCC doesn't havvve this problem) for now. Already sent an email
to jansson open source community to revise these macro as Leif's
suggestion as below,

for (key = json_object_iter_key(json_object_iter(object));    \
       key;                                                   \
       key = json_object_iter_key(                            \
            json_object_iter_next(object,
json_object_key_to_iter(key)))) { \
       value =
json_object_iter_value(json_object_key_to_iter(key));         \
      if (!value) \
        break; \
  } \

We will remove this build option once the patch is accepted and
upstreamed.

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
2021-02-24 09:54:14 +00:00
..
jansson@e9ebfa7e77 edk2: jansson submodule for edk2 JSON library 2021-01-09 03:08:51 +00:00
JsonLib.c RedfishPkg/JsonLib: Fix the mistake of removing code by a accident 2021-02-24 08:57:32 +00:00
JsonLib.inf RedfishPkg/JsonLib: Ignore the build error of conditional expression. 2021-02-24 09:54:14 +00:00
Readme.rst RedfishPkg/library: EDK2 port of jansson library 2021-01-09 03:08:51 +00:00
jansson_config.h RedfishPkg/library: EDK2 port of jansson library 2021-01-09 03:08:51 +00:00
jansson_private_config.h RedfishPkg/library: EDK2 port of jansson library 2021-01-09 03:08:51 +00:00
load.c RedfishPkg/library: EDK2 port of jansson library 2021-01-09 03:08:51 +00:00

Readme.rst

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=============================================================================
                             Introduction
=============================================================================
  Jansson is a C library for encoding, decoding and manipulating JSON data.
Its main features and design principles are:

  - Simple and intuitive API and data model
  - Comprehensive documentation
  - No dependencies on other libraries
  - Full Unicode support (UTF-8)
  - Extensive test suite

  Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2).
It is used in production and its API is stable. It works on numerous
platforms, including numerous Unix like systems and Windows. It's suitable
for use on any system, including desktop, server, and small embedded systems.

  In UEFI/EDKII environment, Redfish project consumes jansson to achieve JSON
operations.

* Jansson version on edk2: 2.13.1, API reference is on the below URL,
  https://jansson.readthedocs.io/en/2.13/apiref.html

* EDKII jansson library wrapper:
   - JsonLib.h:
     This is the denifitions of EDKII JSON APIs which are mapped to
     jannson funcitons accordingly.

*Known issue:
   Build fail with jansson/src/load.c, add code in load.c to conditionally
   use stdin according to HAVE_UNISTD_H macro. The PR is submitted to
   jansson open source community.
   https://github.com/akheron/jansson/pull/558