Changeset 82149f4 for lib/oauth2.c


Ignore:
Timestamp:
2023-03-04T19:59:09Z (14 months ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
50d0a72
Parents:
709f41f
git-author:
Petr Vaněk <arkamar@…> (04-03-23 19:59:09)
git-committer:
GitHub <noreply@…> (04-03-23 19:59:09)
Message:

Fixes related to external-json-parser (#165)

  • configure: append conditionally json-parser to pc file

json-parser needs to be appended to Requires section of pkg-config file
when bitlbee is configured to use external-json-parser. This change is
needed for external plugins like bitlbee-steam.

  • Makefile: do not install json.h when system json-parser is used

install-dev target should not install bundled json.h when bitlbee is
configured to use external-json-parser.

  • Use correct json.h header file with respect to external_json_parser value

The preprocessor must include correct json.h header file with respect to
external_json_parser value, otherwise function prototypes and other
definitions do not need to correspond with object used for linking.

The state before this commit is that local version lib/json.h is used
always for compilation and external_json_parser variable controls if
local lib/json.o or global libjsonparser.so will be linked.

In order to fix this problem, #include directives in lib/json_util.h and
lib/oauth2.c were changed from "json.h" to <json.h> and preprocessor -I
flags were moved after conditional json-parser flags, which is enough
for solving the issue. Additionally, USE_EXTERNAL_JSON_PARSER macro is
exported when external-json-parser is used and it is used in lib/json.h
to trigger an error message, which should prevent similar mistakes in
future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth2.c

    r709f41f r82149f4  
    4242#include "oauth2.h"
    4343#include "oauth.h"
    44 #include "json.h"
     44#include <json.h>
    4545#include "json_util.h"
    4646#include "url.h"
Note: See TracChangeset for help on using the changeset viewer.