PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

PocketHAL Library #include's

I just upgraded from PocketHAL 0.4 to 0.6. In 0.6 all your internal includes are using < > strings instead of "", which means that PocketHAL must be installed in an "official" header include path. I think you should change them all to local path includes so that the PocketHAL library can be placed anywhere (ie within the project source files, instead of the Pocket PC SDK directory).

The four particular includes are:
input.h:11
surface.h:11,12
display.h:12

Dan East
Good idea. I will update this.
Dan East wrote:I just upgraded from PocketHAL 0.4 to 0.6. In 0.6 all your internal includes are using < > strings instead of "", which means that PocketHAL must be installed in an "official" header include path. I think you should change them all to local path includes so that the PocketHAL library can be placed anywhere (ie within the project source files, instead of the Pocket PC SDK directory).

If I remember the ANSI standard (in)correctly from those old days when I was writing compilers, it should not really matter. The rules are along the lines of "" includes vs. <> includes are evaluated in a different order, but for all practical purposes they should hit the same directories. The only rule that applies is that <> would not hit your current project directory. Or in the words of the IBM transliteration of the ANSI standard (CPI C Level 2; don't have the original ANSI document with me):

"If the file name is enclosed in double quotation marks, the preprocessor searches the place that contains the source file, then a standard or specified sequence of places until it finds the specified file.

If the file name is enclosed in the characters < and >, the preprocessor searches only the standard or specified places for the specified file."

"Standard places" corresponds to system library header directories (official in your terminology), "specified" to additional ones specified using -I or whatever your compiler uses as option.

Of course, VC might be broken here, but that would surprise me...

Just nitpicking... :wink:

- HM
We're saying the same thing, but it does matter because of the difference you state. " " is more flexible than < >, because it includes the path the source code file resides in. I suggested that PocketHAL use #include " ", so the PocketHAL library can be relative to the source file, not in one of the include search paths which is currently required.

Dan East
Dan East wrote:We're saying the same thing, but it does matter because of the difference you state. " " is more flexible than < >, because it includes the path the source code file resides in. I suggested that PocketHAL use #include " ", so the PocketHAL library can be relative to the source file, not in one of the include search paths which is currently required.

No problem, it's just that most people I talk to believe <> would be more official than "" when it just means: not my current project.

- HM