There was already a discussion and commit for adding PGDLLIMPORT to some variables which enables extensions to use them on Windows builds. For reference, the previous thread:"Add PGDLLIMPORT lines to some variables".
I would like to add PGDLLIMPORT to enable_hashagg for the same reason. I'm adding a very simple patch. Please let me know if I'm missing anything given that this is my first patch submission.