Skip to content
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

provide #if macros for pn features to not rely only on makefiles #171

Merged
merged 11 commits into from
Dec 7, 2023
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
21 changes: 13 additions & 8 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: c-core
schema: 1
version: "4.7.1"
version: "4.8.0"
scm: github.com/pubnub/c-core
changelog:
- date: 2023-12-07
version: v4.8.0
changes:
- type: feature
text: "Add `#if` switches into files that are related to PubNub features to not rely only on makefiles. [Be careful when update. It's not a breaking change at all but might fail build for custom makefiles!]."
- date: 2023-11-23
version: v4.7.1
changes:
Expand Down Expand Up @@ -768,7 +773,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -834,7 +839,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -900,7 +905,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -962,7 +967,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1023,7 +1028,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1079,7 +1084,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1132,7 +1137,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.7.1
location: https://github.com/pubnub/c-core/releases/tag/v4.8.0
requires:
-
name: "miniz"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v4.8.0
December 07 2023

#### Added
- Add `#if` switches into files that are related to PubNub features to not rely only on makefiles. [Be careful when update. It's not a breaking change at all but might fail build for custom makefiles!].

## v4.7.1
November 23 2023

Expand Down
5 changes: 5 additions & 0 deletions core/pbauto_heartbeat.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_AUTO_HEARTBEAT

#include "pubnub_internal.h"

#if !defined _WIN32
Expand Down Expand Up @@ -756,3 +759,5 @@ void pbauto_heartbeat_stop(void)
m_watcher.stop_heartbeat_watcher_thread = true;
pubnub_mutex_unlock(m_watcher.stoplock);
}

#endif /* PUBNUB_USE_AUTO_HEARTBEAT */
5 changes: 5 additions & 0 deletions core/pbcc_actions_api.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_ACTIONS_API

#include "pubnub_internal.h"
#include "pubnub_version.h"
#include "pubnub_assert.h"
Expand Down Expand Up @@ -624,3 +627,5 @@ enum pubnub_res pbcc_parse_history_with_actions_response(struct pbcc_context* pb

return PNR_OK;
}

#endif /* PUBNUB_USE_ACTIONS_API */
5 changes: 4 additions & 1 deletion core/pbcc_actions_api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_ACTIONS_API

#if !defined INC_PBCC_ACTIONS_API
#define INC_PBCC_ACTIONS_API

Expand Down Expand Up @@ -105,5 +108,5 @@ enum pubnub_res pbcc_parse_history_with_actions_response(struct pbcc_context* pb

#endif /* !defined INC_PBCC_ACTIONS_API */


#endif /* PUBNUB_USE_ACTIONS_API */

6 changes: 6 additions & 0 deletions core/pbcc_objects_api.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_OBJECTS_API

#include "pubnub_internal.h"
#include "pubnub_version.h"
#include "pubnub_assert.h"
Expand Down Expand Up @@ -815,3 +818,6 @@ enum pubnub_res pbcc_parse_objects_api_response(struct pbcc_context* pb)

return PNR_OK;
}

#endif /* PUBNUB_USE_OBJECTS_API */

6 changes: 6 additions & 0 deletions core/pbcc_objects_api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_OBJECTS_API

#if !defined INC_PBCC_OBJECTS_API
#define INC_PBCC_OBJECTS_API

Expand Down Expand Up @@ -154,3 +157,6 @@ enum pubnub_res pbcc_parse_objects_api_response(struct pbcc_context* pb);


#endif /* !defined INC_PBCC_OBJECTS_API */

#endif /* PUBNUB_USE_OBJECTS_API */

6 changes: 6 additions & 0 deletions core/pbcc_subscribe_v2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_SUBSCRIBE_V2

#include "pubnub_internal.h"

#include "pubnub_version.h"
Expand Down Expand Up @@ -326,3 +329,6 @@ struct pubnub_v2_message pbcc_get_msg_v2(struct pbcc_context* p)

return rslt;
}

#endif /* PUBNUB_USE_SUBSCRIBE_V2 */

6 changes: 6 additions & 0 deletions core/pbcc_subscribe_v2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_SUBSCRIBE_V2

#if !defined INC_PBCC_SUBSCRIBE_V2
#define INC_PBCC_SUBSCRIBE_V2

Expand Down Expand Up @@ -35,3 +38,6 @@ struct pubnub_v2_message pbcc_get_msg_v2(struct pbcc_context* p);


#endif /* !defined INC_PBCC_SUBSCRIBE_V2 */

#endif /* PUBNUB_USE_SUBSCRIBE_V2 */

5 changes: 5 additions & 0 deletions core/pbgzip_compress.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_GZIP_COMPRESSION

#include "pubnub_internal.h"

#include "core/pubnub_assert.h"
Expand Down Expand Up @@ -129,3 +132,5 @@ enum pubnub_res pbgzip_compress(pubnub_t* pb, char const* message)

return deflate_total_to_context_buffer(pb, message, size);
}

#endif /* PUBNUB_USE_GZIP_COMPRESSION */
5 changes: 5 additions & 0 deletions core/pbgzip_compress.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_GZIP_COMPRESSION

#if !defined INC_PUBNUB_COMPRESSION
#define INC_PUBNUB_COMPRESSION

Expand All @@ -12,3 +15,5 @@
enum pubnub_res pbgzip_compress(pubnub_t *pb, char const* message);

#endif /* INC_PUBNUB_COMPRESSION */

#endif /* PUBNUB_USE_GZIP_COMPRESSION */
6 changes: 6 additions & 0 deletions core/pbgzip_decompress.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_RECEIVE_GZIP_RESPONSE

#include "pubnub_internal.h"

#include "core/pubnub_assert.h"
Expand Down Expand Up @@ -164,3 +167,6 @@ enum pubnub_res pbgzip_decompress(pubnub_t* pb)
return inflate_total(
pb, data + GZIP_HEADER_LENGTH_BYTES, size, (size_t)unpacked_size);
}

#endif /* PUBNUB_RECEIVE_GZIP_RESPONSE */

6 changes: 6 additions & 0 deletions core/pbgzip_decompress.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_RECEIVE_GZIP_RESPONSE

#if !defined INC_PUBNUB_DECOMPRESSION
#define INC_PUBNUB_DECOMPRESSION

Expand All @@ -19,3 +22,6 @@ enum pubnub_data_compressionType{
enum pubnub_res pbgzip_decompress(pubnub_t *pb);

#endif /* INC_PUBNUB_DECOMPRESSION */

#endif /* PUBNUB_RECEIVE_GZIP_RESPONSE */

5 changes: 5 additions & 0 deletions core/pbhttp_digest.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#include "pubnub_internal.h"

#include "core/pubnub_proxy_core.h"
Expand Down Expand Up @@ -319,3 +322,5 @@ int pbhttp_digest_prep_header_to_send(struct pbhttp_digest_context* ctx,

return 0;
}

#endif /* PUBNUB_PROXY_API */
5 changes: 5 additions & 0 deletions core/pbhttp_digest.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#if !defined INC_PBHTTP_DIGEST
#define INC_PBHTTP_DIGEST

Expand Down Expand Up @@ -152,3 +155,5 @@ char const* pbhttp_digest_algorithm2str(enum pbhttp_digest_algorithm e);


#endif /* !defined INC_PBHTTP_DIGEST */
#endif /* PUBNUB_PROXY_API */

5 changes: 5 additions & 0 deletions core/pbntlm_core.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#include "core/pbntlm_core.h"

#include "core/pbntlm_packer.h"
Expand Down Expand Up @@ -81,3 +84,5 @@ int pbntlm_core_prep_msg_to_send(pubnub_t *pb, pubnub_bymebl_t* data)
}
}

#endif /* PUBNUB_PROXY_API */

4 changes: 4 additions & 0 deletions core/pbntlm_core.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#if !defined INC_PBNTLM_CORE
#define INC_PBNTLM_CORE

Expand All @@ -16,3 +19,4 @@ int pbntlm_core_prep_msg_to_send(pubnub_t *pb, pubnub_bymebl_t* data);


#endif /* !defined INC_PBNTLM_CORE */
#endif /* PUBNUB_PROXY_API */
5 changes: 5 additions & 0 deletions core/pbntlm_packer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#if !defined INC_PBNTLM_PACKER
#define INC_PBNTLM_PACKER

Expand All @@ -19,3 +22,5 @@ void pbntlm_packer_deinit(pbntlm_ctx_t *pb);


#endif /* !defined INC_PBNTLM_PACKER */
#endif /* PUBNUB_PROXY_API */

6 changes: 6 additions & 0 deletions core/pbntlm_packer_sspi.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#include "pbntlm_packer.h"

#include "pubnub_log.h"
Expand Down Expand Up @@ -212,3 +215,6 @@ void pbntlm_packer_deinit(pbntlm_ctx_t *pb)
SecInvalidateHandle(&pb->hcreds);
}
}

#endif /* PUBNUB_PROXY_API */

5 changes: 5 additions & 0 deletions core/pbntlm_packer_std.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_PROXY_API

#include "pbntlm_packer.h"

#include "pubnub_log.h"
Expand Down Expand Up @@ -51,3 +54,5 @@ void pbntlm_packer_deinit(pbntlm_ctx_t *pb)
{
PUBNUB_UNUSED(pb);
}

#endif /* PUBNUB_PROXY_API */
6 changes: 6 additions & 0 deletions core/pubnub_actions_api.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_ACTIONS_API

#include "pubnub_internal.h"

#include "core/pubnub_ccore.h"
Expand Down Expand Up @@ -267,3 +270,6 @@ enum pubnub_res pubnub_history_with_message_actions_more(pubnub_t* pb)

return rslt;
}

#endif /* PUBNUB_USE_ACTIONS_API */

6 changes: 6 additions & 0 deletions core/pubnub_actions_api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_ACTIONS_API

#if !defined INC_PUBNUB_ACTIONS_API
#define INC_PUBNUB_ACTIONS_API

Expand Down Expand Up @@ -160,3 +163,6 @@ PUBNUB_EXTERN enum pubnub_res pubnub_history_with_message_actions_more(pubnub_t*


#endif /* !defined INC_PUBNUB_ACTIONS_API */

#endif /* PUBNUB_USE_ACTIONS_API */

6 changes: 6 additions & 0 deletions core/pubnub_advanced_history.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if PUBNUB_USE_ADVANCED_HISTORY

#if !defined INC_PUBNUB_ADVANCED_HISTORY
#define INC_PUBNUB_ADVANCED_HISTORY

Expand Down Expand Up @@ -62,3 +65,6 @@ PUBNUB_EXTERN int pubnub_get_message_counts(pubnub_t* pb, char const*channel, in


#endif /* !defined INC_PUBNUB_ADVANCED_HISTORY */

#endif /* PUBNUB_USE_ADVANCED_HISTORY */

1 change: 1 addition & 0 deletions core/pubnub_auto_heartbeat.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */

#if !defined INC_PUBNUB_AUTO_HEARTBEAT
#define INC_PUBNUB_AUTO_HEARTBEAT

Expand Down
Loading
Loading