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

GEODE-9559: demacroize clicache #862

Closed

Conversation

mmartell
Copy link
Contributor

Macros in C++ complicate debug efforts and code maintenance and are generally considered old school. This PR is to remove all the complicated macros in the .NET Framework client, e.g. the clicache module.

In addition to improving the maintainability of the clicache module, removing the macros will greatly assist the creation of the .NET Core client. dotPeek is proving to be a valuable tool in the .NET Core project, but is currently limited by the extensive use of macros in the clicache code.

@mmartell mmartell marked this pull request as draft August 28, 2021 22:35
@mmartell mmartell marked this pull request as ready for review August 30, 2021 04:08
@mmartell mmartell requested a review from jake-at-work August 30, 2021 04:08
@mmartell
Copy link
Contributor Author

The procedure for this PR consisted of cutting/pasting the original macro invocations with the corresponding preprocessor output. Although there are quite a few files involved, the changes are basically all the same. For this reason it seemed prudent to submit this as a single PR.

clicache/src/Cache.cpp Outdated Show resolved Hide resolved
clicache/src/Cache.cpp Show resolved Hide resolved
clicache/src/CacheTransactionManager.cpp Show resolved Hide resolved
clicache/src/CacheableBuiltins.hpp Outdated Show resolved Hide resolved
clicache/src/CacheableHashSet.hpp Outdated Show resolved Hide resolved
clicache/src/ExceptionTypes.hpp Show resolved Hide resolved
@jake-at-work
Copy link
Contributor

The procedure for this PR consisted of cutting/pasting the original macro invocations with the corresponding preprocessor output. Although there are quite a few files involved, the changes are basically all the same. For this reason it seemed prudent to submit this as a single PR.

Is there a way to get the preprocessor to do this for you for specific macros only and then preserve that output so we can be certain there are not copy/paste errors?

@mmartell
Copy link
Contributor Author

mmartell commented Sep 2, 2021

Although Microsoft has a new preprocessor that follows the standard (I didn't even know there was a standard), it doesn't appear to allow enabling/disabling specific macro expansion. However, I'm not too worried about copy/paste errors here. The compiler and subsequent clicache tests should catch any errors.

Copy link
Contributor

@jake-at-work jake-at-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the time to review. I will just remove my block.

@jake-at-work jake-at-work dismissed their stale review September 8, 2021 21:18

I don't have the time to review. I will just remove my block.

Copy link

@echobravopapa echobravopapa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's re-group on this effort to make large changes to soon to be deprecated library

@mmartell
Copy link
Contributor Author

Closing this PR since it doesn't add new functionality or fix an existing bug. For anyone interested in decompiling the C++/CLI code they can checkout my branch: mmartell:GEODE-9559-demacroize-clicache

@mmartell mmartell closed this Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants