Skip to content

Change some marcos and API calls to be suitable for windows#119

Open
unbadfish wants to merge 3 commits into
jlaurens:mainfrom
unbadfish:winpatch
Open

Change some marcos and API calls to be suitable for windows#119
unbadfish wants to merge 3 commits into
jlaurens:mainfrom
unbadfish:winpatch

Conversation

@unbadfish

Copy link
Copy Markdown

My editor deleted some trailing spaces, which makes a lot of differences between old file and new file. The main edits are simple:

  1. in synctex_parser_utils.c: L 168-169

As synctex is based on 8 bits characters, including UTF8, not 16 bits nor 32 bits, change default API calls (auto expand to W) to As.

synctex/synctex_parser.h

Lines 91 to 93 in 9176177

* file system, assuming that it is based on
* 8 bits characters, including UTF8,
* not 16 bits nor 32 bits.

- last_component = PathFindFileName(string);
- last_extension = PathFindExtension(string);
+ last_component = PathFindFileNameA(string);
+ last_extension = PathFindExtensionA(string);
  1. in synctex_parser_utils.h: L 90
    GCC's __attribute__ extension is not useable in windows. re-define it to dummy.

https://stackoverflow.com/questions/28411283/dealing-with-attribute-in-msvc

#	if defined(_MSC_VER)
-#		define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK)
+#		define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK)
#	else
#		define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) __attribute__((__format__ (__printf__, (STRING_INDEX), (FIRST_TO_CHECK))))
#	endif

@unbadfish

Copy link
Copy Markdown
Author

When upgrading synctex in https://github.com/sumatrapdfreader/sumatrapdf , I came up with some compile error. This PR is mainly from sumatrapdfreader/sumatrapdf@374896d

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.

2 participants