Github user jablko commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1408#discussion_r99212271
  
    --- Diff: iocore/cache/Cache.cc ---
    @@ -1041,12 +1041,12 @@ CacheProcessor::cacheInitialized()
           case CACHE_COMPRESSION_FASTLZ:
             break;
           case CACHE_COMPRESSION_LIBZ:
    -#if !TS_HAS_LIBZ
    +#ifndef HAVE_ZLIB_H
    --- End diff --
    
    Yes to everything -- except I think we should be clear about which macros 
are either defined or undefined and which are either 1 or 0. Long term, I think 
we should only use one type or the other. For better or worse, Autoconf 
consistently uses defined/undefined.
    
    I think we should consistently use #ifdef with defined/undefined macros 
because it's an indication of their type. I take seriously your point that #if 
works with either type, I just wonder if that's a good thing -- I wonder if it 
might obscure things. My feeling is that it's better to avoid mixing them -- 
avoid cases where a macro is possibly 0 and possibly undefined. I dunno -- 
someone might be tempted to refactor the following:
    
    ```C++
    #if HAVE_ZLIB_H
      print_feature("TS_HAS_LIBZ", 1, json);
    #else
      print_feature("TS_HAS_LIBZ", 0, json);
    #endif
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to